From: xue <2144439972@qq.com> Date: Wed, 10 Sep 2025 06:55:21 +0000 (+0800) Subject: 优化雷鸟流程 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~103^2~1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F2217%2Fhead;p=mirrors%2FFD230.git 优化雷鸟流程 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h deleted file mode 100644 index f0170b685..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef THUNDERBIRD_DIALOGUE_VIEW_H_ -#define THUNDERBIRD_DIALOGUE_VIEW_H_ - -#include "View.h" -#include "components/ui_view_group.h" -#include "components/ui_label_ext.h" -#include "components/ui_image_view.h" - -namespace OHOS -{ - class ThunderBirdDialogueView - { - public: - ThunderBirdDialogueView(); - virtual ~ThunderBirdDialogueView(); - static ThunderBirdDialogueView *GetInstance(void); - UIViewGroup *ThunderBirdDialogueViewInit(void); - void ClearAll(void); - void Show(int16_t showView); - - enum : int16_t { - THUNDERBIRD_DIALOGUEVIEW_SPEAKING = 0, // 说话中 - THUNDERBIRD_DIALOGUEVIEW_LISTENING, // 聆听中 - THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW, // 状态展示 - }; - - private: - UIViewGroup *group{nullptr}; - UILabelExt *titleLabel{nullptr}; - UILabelExt *TextLabel{nullptr}; - UILabelExt *RemindLabel{nullptr}; - UIImageView *RemindIcon{nullptr}; - UIImageView *RemindIcon2{nullptr}; - UIImageView *BackGround{nullptr}; - }; -} - -#endif - diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdView.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdView.h deleted file mode 100644 index 13b192cc8..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdView.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef THUNDERBIRD_VIEW_H_ -#define THUNDERBIRD_VIEW_H_ - -#include "View.h" -#include "components/ui_scroll_view.h" -#include "components/ui_view_group.h" -#include "components/ui_label_ext.h" -#include "components/ui_image_view.h" -namespace OHOS -{ - - class ThunderBirdView - { - - public: - ThunderBirdView(); - virtual ~ThunderBirdView(); - static ThunderBirdView *GetInstance(void); - UIViewGroup *ThunderBirdViewInit(void); - - void InitBlackGround(); - void InitText(); - void ClearAll(void); - - private: - UIViewGroup *group{nullptr}; - - - UIImageView *ground{nullptr}; - - UILabelExt *TextLabel{nullptr}; - UILabelExt *RemindLabel{nullptr}; - UIImageView *Remindground{nullptr}; - -#define SCREEN_WIDTH (Screen::GetInstance().GetWidth()) -#define SCREEN_HEIGHT (Screen::GetInstance().GetHeight()) - }; -} -#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp deleted file mode 100644 index 5eefc344f..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp +++ /dev/null @@ -1,174 +0,0 @@ -#include "thunderbird/include/ThunderBirdAdjustView.h" -#include "wearable_log.h" - -namespace OHOS -{ - static ThunderBirdAdjustView *g_pThunderBirdAdjustView{nullptr}; - - ThunderBirdAdjustView::ThunderBirdAdjustView() - { - g_pThunderBirdAdjustView = this; - } - - ThunderBirdAdjustView::~ThunderBirdAdjustView() - { - g_pThunderBirdAdjustView = nullptr; - ClearAll(); - } - - ThunderBirdAdjustView *ThunderBirdAdjustView::GetInstance(void) - { - return g_pThunderBirdAdjustView; - } - - void ThunderBirdAdjustView::ClearAll(void) - { - if (group != nullptr) - { - group->RemoveAll(); - delete group; - group = nullptr; - } - if (titleLabel != nullptr) { delete titleLabel; titleLabel = nullptr; } - if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } - if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } - if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } - if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } - if (BackGround != nullptr) { delete BackGround; BackGround = nullptr; } - } - - UIViewGroup *ThunderBirdAdjustView::ThunderBirdAdjustViewInit(void) - { - group = new UIViewGroup(); - if (group == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdAdjustView::group null!"); - return nullptr; - } - group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - - // 公共控件 - TextLabel = new UILabelExt(); - if (TextLabel) - { - TextLabel->SetPosition(0, 104, 466, 48); - TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34); - TextLabel->SetVisible(false); - group->Add(TextLabel); - } - RemindLabel = new UILabelExt(); - if (RemindLabel) - { - RemindLabel->SetPosition(0, 180, 466, 40); - RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); - RemindLabel->SetVisible(false); - group->Add(RemindLabel); - } - RemindIcon = new UIImageView(); - if (RemindIcon) - { - RemindIcon->SetAutoEnable(false); - RemindIcon->SetVisible(false); - group->Add(RemindIcon); - } - RemindIcon2 = new UIImageView(); - if (RemindIcon2) - { - RemindIcon2->SetAutoEnable(false); - RemindIcon2->SetVisible(false); - group->Add(RemindIcon2); - } - BackGround = new UIImageView(); - if (BackGround) - { - BackGround->SetPosition(0, 0, 300, 300); - BackGround->SetStyle(STYLE_BACKGROUND_COLOR, 0x66191919); - BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0x66); - BackGround->SetVisible(false); - group->Add(BackGround); - } - - return group; - } - - void ThunderBirdAdjustView::Show(int16_t showView) - { - if (group == nullptr) { return; } - if (BackGround) { BackGround->SetVisible(false); } - if (TextLabel) { TextLabel->SetVisible(false); TextLabel->SetY(104); } - if (RemindLabel) { RemindLabel->SetVisible(false); RemindLabel->SetY(180); } - if (RemindIcon) { RemindIcon->SetVisible(false); } - if (RemindIcon2) { RemindIcon2->SetVisible(false); } - - switch (showView) - { - case THUNDERBIRD_ADJUSTVIEW_BIND_SUCCESS: - { - if (TextLabel) - { - TextLabel->SetText("绑定成功"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("设备已成功连接"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(200, 320, 30, 30); - RemindIcon->SetSrc("/user/res/check.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_ADJUSTVIEW_WARNING: - { - if (TextLabel) - { - TextLabel->SetText("异常警告"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请检查设备状态"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(200, 320, 30, 30); - RemindIcon->SetSrc("/user/res/warning.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_ADJUSTVIEW_NETWORK_CONNECTING: - { - if (TextLabel) - { - TextLabel->SetText("网络连接中"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请稍候..."); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(200, 320, 30, 30); - RemindIcon->SetSrc("/user/res/connecting.bin"); - RemindIcon->SetVisible(true); - } - break; - } - default: - break; - } - } -} - - diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp deleted file mode 100644 index 57e4a1a75..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp +++ /dev/null @@ -1,180 +0,0 @@ -#include "thunderbird/include/ThunderBirdDialogueView.h" -#include "wearable_log.h" - -namespace OHOS -{ - static ThunderBirdDialogueView *g_pThunderBirdDialogueView{nullptr}; - - ThunderBirdDialogueView::ThunderBirdDialogueView() - { - g_pThunderBirdDialogueView = this; - } - - ThunderBirdDialogueView::~ThunderBirdDialogueView() - { - g_pThunderBirdDialogueView = nullptr; - ClearAll(); - } - - ThunderBirdDialogueView *ThunderBirdDialogueView::GetInstance(void) - { - return g_pThunderBirdDialogueView; - } - - void ThunderBirdDialogueView::ClearAll(void) - { - if (group != nullptr) - { - group->RemoveAll(); - delete group; - group = nullptr; - } - if (titleLabel != nullptr) { delete titleLabel; titleLabel = nullptr; } - if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } - if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } - if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } - if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } - if (BackGround != nullptr) { delete BackGround; BackGround = nullptr; } - } - - UIViewGroup *ThunderBirdDialogueView::ThunderBirdDialogueViewInit(void) - { - group = new UIViewGroup(); - if (group == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView::group null!"); - return nullptr; - } - group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - - // 公共控件 - TextLabel = new UILabelExt(); - if (TextLabel) - { - TextLabel->SetPosition(0, 104, 466, 48); - TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34); - TextLabel->SetVisible(false); - group->Add(TextLabel); - } - RemindLabel = new UILabelExt(); - if (RemindLabel) - { - RemindLabel->SetPosition(0, 180, 466, 40); - RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); - RemindLabel->SetVisible(false); - group->Add(RemindLabel); - } - RemindIcon = new UIImageView(); - if (RemindIcon) - { - RemindIcon->SetAutoEnable(false); - RemindIcon->SetVisible(false); - group->Add(RemindIcon); - } - RemindIcon2 = new UIImageView(); - if (RemindIcon2) - { - RemindIcon2->SetAutoEnable(false); - RemindIcon2->SetVisible(false); - group->Add(RemindIcon2); - } - BackGround = new UIImageView(); - if (BackGround) - { - BackGround->SetPosition(0, 0, 300, 300); - BackGround->SetStyle(STYLE_BACKGROUND_COLOR, 0x66191919); - BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0x66); - BackGround->SetVisible(false); - group->Add(BackGround); - } - - return group; - } - - void ThunderBirdDialogueView::Show(int16_t showView) - { - if (group == nullptr) { return; } - if (BackGround) { BackGround->SetVisible(false); } - if (TextLabel) { TextLabel->SetVisible(false); TextLabel->SetY(104); } - if (RemindLabel) { RemindLabel->SetVisible(false); RemindLabel->SetY(180); } - if (RemindIcon) { RemindIcon->SetVisible(false); } - if (RemindIcon2) { RemindIcon2->SetVisible(false); } - - switch (showView) - { - case THUNDERBIRD_DIALOGUEVIEW_SPEAKING: - { - if (TextLabel) - { - TextLabel->SetText("说话中"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("正在为您播放语音"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(200, 320, 30, 30); - RemindIcon->SetSrc("/user/res/speaking.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_DIALOGUEVIEW_LISTENING: - { - if (TextLabel) - { - TextLabel->SetText("聆听中"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请说出您的需求"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(200, 320, 30, 30); - RemindIcon->SetSrc("/user/res/listening.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW: - { - if (TextLabel) - { - TextLabel->SetText("状态展示"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 取消 按 确认"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(140, 320, 30, 30); - RemindIcon->SetSrc("/user/res/volumedown.bin"); - RemindIcon->SetVisible(true); - } - if (RemindIcon2) - { - RemindIcon2->SetPosition(275, 320, 30, 30); - RemindIcon2->SetSrc("/user/res/volumeup.bin"); - RemindIcon2->SetVisible(true); - } - break; - } - default: - break; - } - } -} - - diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp deleted file mode 100644 index 51ee91cdc..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp +++ /dev/null @@ -1,198 +0,0 @@ -#include "thunderbird/include/ThunderBirdLullabyView.h" -#include "wearable_log.h" - -namespace OHOS -{ - static ThunderBirdLullabyView *g_pThunderBirdLullabyView{nullptr}; - - ThunderBirdLullabyView::ThunderBirdLullabyView() - { - g_pThunderBirdLullabyView = this; - } - - ThunderBirdLullabyView::~ThunderBirdLullabyView() - { - g_pThunderBirdLullabyView = nullptr; - ClearAll(); - } - - ThunderBirdLullabyView *ThunderBirdLullabyView::GetInstance(void) - { - return g_pThunderBirdLullabyView; - } - - void ThunderBirdLullabyView::ClearAll(void) - { - if (group != nullptr) - { - group->RemoveAll(); - delete group; - group = nullptr; - } - if (titleLabel != nullptr) { delete titleLabel; titleLabel = nullptr; } - if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } - if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } - if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } - if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } - if (BackGround != nullptr) { delete BackGround; BackGround = nullptr; } - } - - UIViewGroup *ThunderBirdLullabyView::ThunderBirdLullabyViewInit(void) - { - group = new UIViewGroup(); - if (group == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdLullabyView::group null!"); - return nullptr; - } - group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - - // 公共控件 - TextLabel = new UILabelExt(); - if (TextLabel) - { - TextLabel->SetPosition(0, 104, 466, 48); - TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34); - TextLabel->SetVisible(false); - group->Add(TextLabel); - } - RemindLabel = new UILabelExt(); - if (RemindLabel) - { - RemindLabel->SetPosition(0, 180, 466, 40); - RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); - RemindLabel->SetVisible(false); - group->Add(RemindLabel); - } - RemindIcon = new UIImageView(); - if (RemindIcon) - { - RemindIcon->SetAutoEnable(false); - RemindIcon->SetVisible(false); - group->Add(RemindIcon); - } - RemindIcon2 = new UIImageView(); - if (RemindIcon2) - { - RemindIcon2->SetAutoEnable(false); - RemindIcon2->SetVisible(false); - group->Add(RemindIcon2); - } - BackGround = new UIImageView();//有待解决 - if (BackGround) - { - BackGround->SetPosition(0, 0, 300, 300); - BackGround->SetStyle(STYLE_BACKGROUND_COLOR, 0x66191919); - BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0x66); - BackGround->SetVisible(false); - group->Add(BackGround); - } - - return group; - } - - void ThunderBirdLullabyView::Show(int16_t showView) - { - if (group == nullptr) { return; } - if (BackGround) { BackGround->SetVisible(false); } - if (TextLabel) { TextLabel->SetVisible(false); TextLabel->SetY(104); } - if (RemindLabel) { RemindLabel->SetVisible(false); RemindLabel->SetY(180); } - if (RemindIcon) { RemindIcon->SetVisible(false); } - if (RemindIcon2) { RemindIcon2->SetVisible(false); } - - switch (showView) - { - case THUNDERBIRD_LULLABYVIEW_1: - { - if (TextLabel) - { - TextLabel->SetText("按 说“哄我睡觉”"); - TextLabel->SetVisible(true); - } - if(RemindIcon) - { - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_LULLABYVIEW_2: - { - if (TextLabel) - { - TextLabel->SetText("是否开启哄睡模式"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 取消 按 确认"); - RemindLabel->SetVisible(true); - } - break; - } - case THUNDERBIRD_LULLABYVIEW_3: - { - if (TextLabel) - { - TextLabel->SetText(" 告诉我想听的故事"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 取消 按 确认"); - RemindLabel->SetVisible(true); - } - break; - } - case THUNDERBIRD_LULLABYVIEW_4: - { - if (TextLabel) - { - TextLabel->SetText("从前有座山"); - TextLabel->SetVisible(true); - } - if(RemindLabel) - { - RemindLabel->SetText("按 下一页"); - RemindLabel->SetVisible(true); - } - break; - } - case THUNDERBIRD_LULLABYVIEW_5: - { - if (TextLabel) - { - TextLabel->SetText("是否退出哄睡模式"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if(RemindLabel) - { - RemindLabel->SetY(320); - RemindLabel->SetText("按 取消 按 确认"); - RemindLabel->SetVisible(true); - } - if(RemindIcon) - { - RemindIcon->SetPosition(130, 320, 30, 30); - RemindIcon->SetSrc("/user/res/volumedown.bin"); - RemindIcon->SetVisible(true); - } - if(RemindIcon2) - { - RemindIcon2->SetPosition(280, 320, 30, 30); - RemindIcon2->SetSrc("/user/res/volumeup.bin"); - RemindIcon2->SetVisible(true); - } - break; - } - default: - break; - } - } -} - - diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp deleted file mode 100644 index 23fbbaf04..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/*** - * @Date: 2024-06-22 18:08:25 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-06-24 11:30:12 - * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThunderBirdModel.cpp - */ -/* - * @Author: luozheng 1732036298@qq.com - * @Date: 2024-06-07 09:21:47 - * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-11-05 14:49:01 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/ThunderBirdModel.cpp - */ - -#include "thunderbird/include/ThunderBirdModel.h" -#include "thunderbird/include/ThunderBirdView.h" -#include "thunderbird/include/ThunderBirdMainView.h" -#include "wearable_log.h" -#include -#include -#include "wearable_log.h" -#include "custom_utils.h" -#include -namespace OHOS -{ - ThunderBirdModel::ThunderBirdModel() {} - ThunderBirdModel::~ThunderBirdModel() {} - - ThunderBirdModel *ThunderBirdModel::GetInstance() - { - static ThunderBirdModel instance; - return &instance; - } - // 获取当前时间戳字符串 - std::string ThunderBirdModel::GetCurrentTimeStr() - { - uint32_t timeStamp = 0; - if (uapi_get_timestampe_ss(&timeStamp) != ERRCODE_SUCC) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to get timestamp"); - return "----/--/-- \n --/--"; - } - // 将时间戳转换为 time_t 类型 - time_t rawtime = static_cast(timeStamp); - struct tm *timeinfo = localtime(&rawtime); - - if (timeinfo == NULL) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to convert time"); - return "----/--/-- \n --/--"; - } - - // 格式化时间为字符串 (HH:MM:SS format) - char buffer[20]; // 格式: HH:MM:SS - std::strftime(buffer, sizeof(buffer), "%H:%M", timeinfo); - return std::string(buffer); - } - void ThunderBirdModel::timer_callback_proc() - { - ThunderBirdMainView *view = ThunderBirdMainView::GetInstance(); - if (view) - { - view->UpdateTimeText(GetCurrentTimeStr().c_str()); - } - } - - static osTimerId_t g_timer = nullptr; - /*定时器到期时的处理*/ - static void TimerCallbackProc(uint8_t data) - { - // 倒计时 - ThunderBirdModel::GetInstance()->timer_callback_proc(); - ThunderBirdMainView::GetInstance()->updateSignalDisplay(); - ThunderBirdMainView::GetInstance()->UpdateBatteryProcess(); - } - /* - * @brief 回调函数 - */ - static void TimerCallback(uint8_t data) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TimerCallback %d", data); - GraphicService::GetInstance()->PostGraphicEvent( - std::bind(TimerCallbackProc, data)); - } - - /* - * @brief 开启定时器函数 - * @param interval 时间间隔,单位ms - */ - void ThunderBirdModel::StartTimer(uint32_t interval) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::StartTimer"); - /* -------------------------- 1.检查定时器是否已经存在,如果存在则返回 - * ------------------------- */ - if (g_timer != nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Timer already exists!!"); - return; - } - - /* --------------------------------- 2.创建定时器 - * -------------------------------- */ - g_timer = osTimerNew((osTimerFunc_t)TimerCallback, osTimerPeriodic, - nullptr, nullptr); - // 检查定时器创建是否成功 - if (g_timer == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Timer create failed!!"); - return; - } - - /* ----------------------------- 3.将毫秒转换为系统时钟节拍数 - * ---------------------------- */ - /* --------------------------------- 4.启动定时器 - * -------------------------------- */ - osStatus_t ret = osTimerStart(g_timer, interval); - /* -------------------- 5.检查定时器启动是否成功,如果启动失败,删除定时器并置为 - * nullptr -------------------- */ - if (ret != osOK) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, - "osTimerDelete failed, ret = %lx!!", ret); - if (g_timer != nullptr) - { - ret = osTimerDelete(g_timer); - } - g_timer = nullptr; - return; - } - } - /* - * @brief 停止定时器 - */ - void ThunderBirdModel::StopTimer(void) - { - // 检查定时器是否存在 - if (g_timer != nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::BP_StopTimer"); - osTimerStop(g_timer); - // 删除定时器并置为 nullptr - osStatus_t ret = osTimerDelete(g_timer); - if (ret != osOK) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, - "osTimerDelete failed, ret = %lx!!", ret); - } - g_timer = nullptr; - } - } - -} diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdOtaView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdOtaView.cpp deleted file mode 100644 index c65774749..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdOtaView.cpp +++ /dev/null @@ -1,340 +0,0 @@ -#include "thunderbird/include/ThunderBirdOtaView.h" -#include "wearable_log.h" - -namespace OHOS -{ - static ThunderBirdOtaView *g_pThunderBirdOtaView{nullptr}; - - ThunderBirdOtaView::ThunderBirdOtaView() - { - g_pThunderBirdOtaView = this; - } - - ThunderBirdOtaView::~ThunderBirdOtaView() - { - g_pThunderBirdOtaView = nullptr; - ClearAll(); - } - - ThunderBirdOtaView *ThunderBirdOtaView::GetInstance(void) - { - return g_pThunderBirdOtaView; - } - - void ThunderBirdOtaView::ClearAll(void) - { - if (group != nullptr) - { - group->RemoveAll(); - delete group; - group = nullptr; - } - if (titleLabel != nullptr) { delete titleLabel; titleLabel = nullptr; } - if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } - if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } - if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } - if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } - if (BackGround != nullptr) { delete BackGround; BackGround = nullptr; } - } - - UIViewGroup *ThunderBirdOtaView::ThunderBirdOtaViewInit(void) - { - group = new UIViewGroup(); - if (group == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdOtaView::group null!"); - return nullptr; - } - group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - - // 公共控件 - TextLabel = new UILabelExt(); - if (TextLabel) - { - TextLabel->SetPosition(0, 104, 466, 48); - TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34); - TextLabel->SetVisible(false); - group->Add(TextLabel); - } - RemindLabel = new UILabelExt(); - if (RemindLabel) - { - RemindLabel->SetPosition(0, 180, 466, 40); - RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); - RemindLabel->SetVisible(false); - group->Add(RemindLabel); - } - RemindIcon = new UIImageView(); - if (RemindIcon) - { - RemindIcon->SetAutoEnable(false); - RemindIcon->SetVisible(false); - group->Add(RemindIcon); - } - RemindIcon2 = new UIImageView(); - if (RemindIcon2) - { - RemindIcon2->SetAutoEnable(false); - RemindIcon2->SetVisible(false); - group->Add(RemindIcon2); - } - BackGround = new UIImageView(); - if (BackGround) - { - BackGround->SetPosition(0, 0, 300, 300); - BackGround->SetStyle(STYLE_BACKGROUND_COLOR, 0x66191919); - BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0x66); - BackGround->SetVisible(false); - group->Add(BackGround); - } - - return group; - } - - void ThunderBirdOtaView::Show(int16_t showView) - { - if (group == nullptr) { return; } - if (BackGround) { BackGround->SetVisible(false); } - if (TextLabel) { TextLabel->SetVisible(false); TextLabel->SetY(104); } - if (RemindLabel) { RemindLabel->SetVisible(false); RemindLabel->SetY(180); } - if (RemindIcon) { RemindIcon->SetVisible(false); } - if (RemindIcon2) { RemindIcon2->SetVisible(false); } - - switch (showView) - { - case THUNDERBIRD_OTAVIEW_READY: - { - if (TextLabel) - { - TextLabel->SetText("OTA 就绪"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 检查更新"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(180, 175, 30, 30); - RemindIcon->SetSrc("/user/res/volumeup.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_NEW_FEATURE: - { - if (TextLabel) - { - TextLabel->SetText("有新功能可用"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 取消 按 更新"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(140, 320, 30, 30); - RemindIcon->SetSrc("/user/res/volumedown.bin"); - RemindIcon->SetVisible(true); - } - if (RemindIcon2) - { - RemindIcon2->SetPosition(275, 320, 30, 30); - RemindIcon2->SetSrc("/user/res/volumeup.bin"); - RemindIcon2->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_UPDATE_NOW: - { - if (TextLabel) - { - TextLabel->SetText("需要立即更新"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 取消 按 立即更新"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(140, 320, 30, 30); - RemindIcon->SetSrc("/user/res/volumedown.bin"); - RemindIcon->SetVisible(true); - } - if (RemindIcon2) - { - RemindIcon2->SetPosition(275, 320, 30, 30); - RemindIcon2->SetSrc("/user/res/volumeup.bin"); - RemindIcon2->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_NIGHT_UPDATE: - { - if (TextLabel) - { - TextLabel->SetText("设置夜间更新"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 取消 按 确认"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(140, 320, 30, 30); - RemindIcon->SetSrc("/user/res/volumedown.bin"); - RemindIcon->SetVisible(true); - } - if (RemindIcon2) - { - RemindIcon2->SetPosition(275, 320, 30, 30); - RemindIcon2->SetSrc("/user/res/volumeup.bin"); - RemindIcon2->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS: - { - if (TextLabel) - { - TextLabel->SetText("夜间更新设置成功"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("将在夜间自动更新"); - RemindLabel->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_COUNTDOWN: - { - if (TextLabel) - { - TextLabel->SetText("更新倒计时"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 取消更新"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(180, 175, 30, 30); - RemindIcon->SetSrc("/user/res/volumeup.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_LOW_BATTERY: - { - if (TextLabel) - { - TextLabel->SetText("电量不足"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请充电后重试"); - RemindLabel->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_NETWORK_ERROR: - { - if (TextLabel) - { - TextLabel->SetText("网络异常"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请检查网络连接"); - RemindLabel->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_MEMORY_ERROR: - { - if (TextLabel) - { - TextLabel->SetText("内存不足"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请清理存储空间"); - RemindLabel->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS: - { - if (TextLabel) - { - TextLabel->SetText("更新成功"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 重启设备"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(140, 320, 30, 30); - RemindIcon->SetSrc("/user/res/check.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_OTAVIEW_UPDATE_FAILED: - { - if (TextLabel) - { - TextLabel->SetText("更新未完成"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 重试 按 取消"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(140, 320, 30, 30); - RemindIcon->SetSrc("/user/res/volumedown.bin"); - RemindIcon->SetVisible(true); - } - if (RemindIcon2) - { - RemindIcon2->SetPosition(275, 320, 30, 30); - RemindIcon2->SetSrc("/user/res/volumeup.bin"); - RemindIcon2->SetVisible(true); - } - break; - } - default: - break; - } - } -} - - diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp deleted file mode 100644 index 52f289f5d..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp +++ /dev/null @@ -1,242 +0,0 @@ -#include "thunderbird/include/ThunderBirdReminderView.h" -#include "wearable_log.h" - -namespace OHOS -{ - static ThunderBirdReminderView *g_pThunderBirdReminderView{nullptr}; - - ThunderBirdReminderView::ThunderBirdReminderView() - { - g_pThunderBirdReminderView = this; - } - - ThunderBirdReminderView::~ThunderBirdReminderView() - { - g_pThunderBirdReminderView = nullptr; - ClearAll(); - } - - ThunderBirdReminderView *ThunderBirdReminderView::GetInstance(void) - { - return g_pThunderBirdReminderView; - } - - void ThunderBirdReminderView::ClearAll(void) - { - if (group != nullptr) - { - group->RemoveAll(); - delete group; - group = nullptr; - } - if (titleLabel != nullptr) { delete titleLabel; titleLabel = nullptr; } - if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } - if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } - if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } - if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } - if (BackGround != nullptr) { delete BackGround; BackGround = nullptr; } - } - - UIViewGroup *ThunderBirdReminderView::ThunderBirdReminderViewInit(void) - { - group = new UIViewGroup(); - if (group == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdReminderView::group null!"); - return nullptr; - } - group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - - // 公共控件 - TextLabel = new UILabelExt(); - if (TextLabel) - { - TextLabel->SetPosition(0, 104, 466, 48); - TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34); - TextLabel->SetVisible(false); - group->Add(TextLabel); - } - RemindLabel = new UILabelExt(); - if (RemindLabel) - { - RemindLabel->SetPosition(0, 180, 466, 40); - RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); - RemindLabel->SetVisible(false); - group->Add(RemindLabel); - } - RemindIcon = new UIImageView(); - if (RemindIcon) - { - RemindIcon->SetAutoEnable(false); - RemindIcon->SetVisible(false); - group->Add(RemindIcon); - } - RemindIcon2 = new UIImageView(); - if (RemindIcon2) - { - RemindIcon2->SetAutoEnable(false); - RemindIcon2->SetVisible(false); - group->Add(RemindIcon2); - } - BackGround = new UIImageView(); - if (BackGround) - { - BackGround->SetPosition(0, 0, 300, 300); - BackGround->SetStyle(STYLE_BACKGROUND_COLOR, 0x66191919); - BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0x66); - BackGround->SetVisible(false); - group->Add(BackGround); - } - - return group; - } - - void ThunderBirdReminderView::Show(int16_t showView) - { - if (group == nullptr) { return; } - if (BackGround) { BackGround->SetVisible(false); } - if (TextLabel) { TextLabel->SetVisible(false); TextLabel->SetY(104); } - if (RemindLabel) { RemindLabel->SetVisible(false); RemindLabel->SetY(180); } - if (RemindIcon) { RemindIcon->SetVisible(false); } - if (RemindIcon2) { RemindIcon2->SetVisible(false); } - - switch (showView) - { - case THUNDERBIRD_REMINDERVIEW_VOLUME: - { - if (TextLabel) - { - TextLabel->SetText("音量调节"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 减小音量 按 增大音量"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(140, 320, 30, 30); - RemindIcon->SetSrc("/user/res/volumedown.bin"); - RemindIcon->SetVisible(true); - } - if (RemindIcon2) - { - RemindIcon2->SetPosition(275, 320, 30, 30); - RemindIcon2->SetSrc("/user/res/volumeup.bin"); - RemindIcon2->SetVisible(true); - } - break; - } - case THUNDERBIRD_REMINDERVIEW_TASK_REMINDER: - { - if (TextLabel) - { - TextLabel->SetText("事项提醒"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("您有新的提醒事项"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(180, 175, 30, 30); - RemindIcon->SetSrc("/user/res/notification.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT: - { - if (TextLabel) - { - TextLabel->SetText("网络断开"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请检查网络连接"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(180, 175, 30, 30); - RemindIcon->SetSrc("/user/res/wifi_off.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_REMINDERVIEW_LOW_BATTERY: - { - if (TextLabel) - { - TextLabel->SetText("电量不足"); - TextLabel->SetY(160); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请及时充电"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(180, 175, 30, 30); - RemindIcon->SetSrc("/user/res/battery_low.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_REMINDERVIEW_CHARGING: - { - if (TextLabel) - { - TextLabel->SetText("充电中"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("请保持连接"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(200, 320, 30, 30); - RemindIcon->SetSrc("/user/res/charging.bin"); - RemindIcon->SetVisible(true); - } - break; - } - case THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE: - { - if (TextLabel) - { - TextLabel->SetText("充电完成"); - TextLabel->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("可以拔掉充电器"); - RemindLabel->SetVisible(true); - } - if (RemindIcon) - { - RemindIcon->SetPosition(200, 320, 30, 30); - RemindIcon->SetSrc("/user/res/check.bin"); - RemindIcon->SetVisible(true); - } - break; - } - default: - break; - } - } -} - - diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdView.cpp deleted file mode 100644 index 5a964da54..000000000 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdView.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "thunderbird/include/ThunderBirdView.h" -#include "thunderbird/include/ThunderBirdModel.h" -#include "thunderbird/include/ThunderBirdPresenter.h" -#include "wearable_log.h" -#include "NativeAbility.h" -#include "msg_center.h" -#include "securec.h" -#include "common/low_power_manager.h" -#include "common/image_cache_manager.h" -#include "uicomponents/UIComponents.h" - - -namespace OHOS -{ - static ThunderBirdView *g_pThunderBirdView{nullptr}; - - ThunderBirdView::ThunderBirdView() - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdView::ThunderBirdView"); - g_pThunderBirdView = this; - - } - - ThunderBirdView::~ThunderBirdView() - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdView::~ThunderBirdView"); - g_pThunderBirdView = nullptr; - ClearAll(); - RootView::GetInstance()->ClearOnKeyActListener(); - } - - ThunderBirdView *ThunderBirdView::GetInstance() - { - return g_pThunderBirdView; - } - - void ThunderBirdView::ClearAll(void) - { - - // 清理UI组件 - if (group != nullptr) - { - group->RemoveAll(); - delete group; - group = nullptr; - } - } - - UIViewGroup *ThunderBirdView::ThunderBirdViewInit(void) - { - group = new UIViewGroup(); - if (group == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmPopUpView::group null!"); - return nullptr; - } - group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - - // InitBlackGround(); - InitText(); - - return group; - } - - void ThunderBirdView::InitBlackGround() - { - ground = new UIImageView(); - if (ground == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ground new fail"); - return; - } - ground->SetStyle(STYLE_BACKGROUND_COLOR, 0x8D000000); - ground->SetStyle(STYLE_BACKGROUND_OPA, 0x8D); - // ground->SetStyle(STYLE_BORDER_RADIUS, 200); - ground->SetPosition(0, 0, 466, 466); - // ground->SetStyle(STYLE_BORDER_COLOR, Color::Gray().full); - group->Add(ground); - } - void ThunderBirdView::InitText() - { - Remindground = new UIImageView(); - if (Remindground == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Remindground new fail"); - return; - } - Remindground->SetStyle(STYLE_BACKGROUND_COLOR, 0x8D101010); - Remindground->SetStyle(STYLE_BACKGROUND_OPA, 0x8D); - Remindground->SetStyle(STYLE_BORDER_RADIUS, 200); - Remindground->SetPosition(130, 201, 320, 46); - Remindground->SetStyle(STYLE_BORDER_COLOR, Color::Gray().full); - // group->Add(Remindground); - - InitLabel(TextLabel, 100, 104, 300, 48, "TextLabel", "08:52", DEFAULT_VECTOR_FONT_FILENAME, 38); - TextLabel->SetText("Hey, 我是毛毛~"); - TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); - group->Add(TextLabel); - - InitLabel(RemindLabel, 135, 198, 300, 40, "TextLabel", "08:52", DEFAULT_VECTOR_FONT_FILENAME, 30); - RemindLabel->SetText("按 下一页"); - TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); - // group->Add(RemindLabel); - } -} \ No newline at end of file diff --git a/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/AppViewIDs.h index 6c6b38fcb..067b5d932 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/AppViewIDs.h @@ -59,6 +59,7 @@ typedef enum : uint16_t { VIEW_SLEEPING, VIEW_TRAINING, VIEW_EMPTY, + VIEW_THUNDER_BIRD, #ifdef SUPPORT_ALIPAY_SEC VIEW_MAIN_ALIPAY, #endif diff --git a/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/UiConfig.h index b04a143ac..5a9c4761c 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/UiConfig.h @@ -336,6 +336,319 @@ namespace OHOS { static constexpr const char *PNG_A019_094_IMAGE_PATH = APP_RES_PATH"/BLUETOOTH_IMAGE_15.bin"; static constexpr const char *PNG_A019_095_IMAGE_PATH = APP_RES_PATH"/BLUETOOTH_IMAGE_16.bin"; static constexpr const char *PNG_BLUETOOTHEAR = APP_RES_PATH"/BLUETOOTHEAR.bin"; + + // Thunderbird animations: speak 1..25 + static constexpr const char *TB_SPEAK_IMAGE_1 = APP_RES_PATH"/animated_icon/speak/1.bin"; + static constexpr const char *TB_SPEAK_IMAGE_2 = APP_RES_PATH"/animated_icon/speak/2.bin"; + static constexpr const char *TB_SPEAK_IMAGE_3 = APP_RES_PATH"/animated_icon/speak/3.bin"; + static constexpr const char *TB_SPEAK_IMAGE_4 = APP_RES_PATH"/animated_icon/speak/4.bin"; + static constexpr const char *TB_SPEAK_IMAGE_5 = APP_RES_PATH"/animated_icon/speak/5.bin"; + static constexpr const char *TB_SPEAK_IMAGE_6 = APP_RES_PATH"/animated_icon/speak/6.bin"; + static constexpr const char *TB_SPEAK_IMAGE_7 = APP_RES_PATH"/animated_icon/speak/7.bin"; + static constexpr const char *TB_SPEAK_IMAGE_8 = APP_RES_PATH"/animated_icon/speak/8.bin"; + static constexpr const char *TB_SPEAK_IMAGE_9 = APP_RES_PATH"/animated_icon/speak/9.bin"; + static constexpr const char *TB_SPEAK_IMAGE_10 = APP_RES_PATH"/animated_icon/speak/10.bin"; + static constexpr const char *TB_SPEAK_IMAGE_11 = APP_RES_PATH"/animated_icon/speak/11.bin"; + static constexpr const char *TB_SPEAK_IMAGE_12 = APP_RES_PATH"/animated_icon/speak/12.bin"; + static constexpr const char *TB_SPEAK_IMAGE_13 = APP_RES_PATH"/animated_icon/speak/13.bin"; + static constexpr const char *TB_SPEAK_IMAGE_14 = APP_RES_PATH"/animated_icon/speak/14.bin"; + static constexpr const char *TB_SPEAK_IMAGE_15 = APP_RES_PATH"/animated_icon/speak/15.bin"; + static constexpr const char *TB_SPEAK_IMAGE_16 = APP_RES_PATH"/animated_icon/speak/16.bin"; + static constexpr const char *TB_SPEAK_IMAGE_17 = APP_RES_PATH"/animated_icon/speak/17.bin"; + static constexpr const char *TB_SPEAK_IMAGE_18 = APP_RES_PATH"/animated_icon/speak/18.bin"; + static constexpr const char *TB_SPEAK_IMAGE_19 = APP_RES_PATH"/animated_icon/speak/19.bin"; + static constexpr const char *TB_SPEAK_IMAGE_20 = APP_RES_PATH"/animated_icon/speak/20.bin"; + static constexpr const char *TB_SPEAK_IMAGE_21 = APP_RES_PATH"/animated_icon/speak/21.bin"; + static constexpr const char *TB_SPEAK_IMAGE_22 = APP_RES_PATH"/animated_icon/speak/22.bin"; + static constexpr const char *TB_SPEAK_IMAGE_23 = APP_RES_PATH"/animated_icon/speak/23.bin"; + static constexpr const char *TB_SPEAK_IMAGE_24 = APP_RES_PATH"/animated_icon/speak/24.bin"; + static constexpr const char *TB_SPEAK_IMAGE_25 = APP_RES_PATH"/animated_icon/speak/25.bin"; + + // Thunderbird animations: listen 1..61 + static constexpr const char *TB_LISTEN_IMAGE_1 = APP_RES_PATH"/animated_icon/listen/1.bin"; + static constexpr const char *TB_LISTEN_IMAGE_2 = APP_RES_PATH"/animated_icon/listen/2.bin"; + static constexpr const char *TB_LISTEN_IMAGE_3 = APP_RES_PATH"/animated_icon/listen/3.bin"; + static constexpr const char *TB_LISTEN_IMAGE_4 = APP_RES_PATH"/animated_icon/listen/4.bin"; + static constexpr const char *TB_LISTEN_IMAGE_5 = APP_RES_PATH"/animated_icon/listen/5.bin"; + static constexpr const char *TB_LISTEN_IMAGE_6 = APP_RES_PATH"/animated_icon/listen/6.bin"; + static constexpr const char *TB_LISTEN_IMAGE_7 = APP_RES_PATH"/animated_icon/listen/7.bin"; + static constexpr const char *TB_LISTEN_IMAGE_8 = APP_RES_PATH"/animated_icon/listen/8.bin"; + static constexpr const char *TB_LISTEN_IMAGE_9 = APP_RES_PATH"/animated_icon/listen/9.bin"; + static constexpr const char *TB_LISTEN_IMAGE_10 = APP_RES_PATH"/animated_icon/listen/10.bin"; + static constexpr const char *TB_LISTEN_IMAGE_11 = APP_RES_PATH"/animated_icon/listen/11.bin"; + static constexpr const char *TB_LISTEN_IMAGE_12 = APP_RES_PATH"/animated_icon/listen/12.bin"; + static constexpr const char *TB_LISTEN_IMAGE_13 = APP_RES_PATH"/animated_icon/listen/13.bin"; + static constexpr const char *TB_LISTEN_IMAGE_14 = APP_RES_PATH"/animated_icon/listen/14.bin"; + static constexpr const char *TB_LISTEN_IMAGE_15 = APP_RES_PATH"/animated_icon/listen/15.bin"; + static constexpr const char *TB_LISTEN_IMAGE_16 = APP_RES_PATH"/animated_icon/listen/16.bin"; + static constexpr const char *TB_LISTEN_IMAGE_17 = APP_RES_PATH"/animated_icon/listen/17.bin"; + static constexpr const char *TB_LISTEN_IMAGE_18 = APP_RES_PATH"/animated_icon/listen/18.bin"; + static constexpr const char *TB_LISTEN_IMAGE_19 = APP_RES_PATH"/animated_icon/listen/19.bin"; + static constexpr const char *TB_LISTEN_IMAGE_20 = APP_RES_PATH"/animated_icon/listen/20.bin"; + static constexpr const char *TB_LISTEN_IMAGE_21 = APP_RES_PATH"/animated_icon/listen/21.bin"; + static constexpr const char *TB_LISTEN_IMAGE_22 = APP_RES_PATH"/animated_icon/listen/22.bin"; + static constexpr const char *TB_LISTEN_IMAGE_23 = APP_RES_PATH"/animated_icon/listen/23.bin"; + static constexpr const char *TB_LISTEN_IMAGE_24 = APP_RES_PATH"/animated_icon/listen/24.bin"; + static constexpr const char *TB_LISTEN_IMAGE_25 = APP_RES_PATH"/animated_icon/listen/25.bin"; + static constexpr const char *TB_LISTEN_IMAGE_26 = APP_RES_PATH"/animated_icon/listen/26.bin"; + static constexpr const char *TB_LISTEN_IMAGE_27 = APP_RES_PATH"/animated_icon/listen/27.bin"; + static constexpr const char *TB_LISTEN_IMAGE_28 = APP_RES_PATH"/animated_icon/listen/28.bin"; + static constexpr const char *TB_LISTEN_IMAGE_29 = APP_RES_PATH"/animated_icon/listen/29.bin"; + static constexpr const char *TB_LISTEN_IMAGE_30 = APP_RES_PATH"/animated_icon/listen/30.bin"; + static constexpr const char *TB_LISTEN_IMAGE_31 = APP_RES_PATH"/animated_icon/listen/31.bin"; + static constexpr const char *TB_LISTEN_IMAGE_32 = APP_RES_PATH"/animated_icon/listen/32.bin"; + static constexpr const char *TB_LISTEN_IMAGE_33 = APP_RES_PATH"/animated_icon/listen/33.bin"; + static constexpr const char *TB_LISTEN_IMAGE_34 = APP_RES_PATH"/animated_icon/listen/34.bin"; + static constexpr const char *TB_LISTEN_IMAGE_35 = APP_RES_PATH"/animated_icon/listen/35.bin"; + static constexpr const char *TB_LISTEN_IMAGE_36 = APP_RES_PATH"/animated_icon/listen/36.bin"; + static constexpr const char *TB_LISTEN_IMAGE_37 = APP_RES_PATH"/animated_icon/listen/37.bin"; + static constexpr const char *TB_LISTEN_IMAGE_38 = APP_RES_PATH"/animated_icon/listen/38.bin"; + static constexpr const char *TB_LISTEN_IMAGE_39 = APP_RES_PATH"/animated_icon/listen/39.bin"; + static constexpr const char *TB_LISTEN_IMAGE_40 = APP_RES_PATH"/animated_icon/listen/40.bin"; + static constexpr const char *TB_LISTEN_IMAGE_41 = APP_RES_PATH"/animated_icon/listen/41.bin"; + static constexpr const char *TB_LISTEN_IMAGE_42 = APP_RES_PATH"/animated_icon/listen/42.bin"; + static constexpr const char *TB_LISTEN_IMAGE_43 = APP_RES_PATH"/animated_icon/listen/43.bin"; + static constexpr const char *TB_LISTEN_IMAGE_44 = APP_RES_PATH"/animated_icon/listen/44.bin"; + static constexpr const char *TB_LISTEN_IMAGE_45 = APP_RES_PATH"/animated_icon/listen/45.bin"; + static constexpr const char *TB_LISTEN_IMAGE_46 = APP_RES_PATH"/animated_icon/listen/46.bin"; + static constexpr const char *TB_LISTEN_IMAGE_47 = APP_RES_PATH"/animated_icon/listen/47.bin"; + static constexpr const char *TB_LISTEN_IMAGE_48 = APP_RES_PATH"/animated_icon/listen/48.bin"; + static constexpr const char *TB_LISTEN_IMAGE_49 = APP_RES_PATH"/animated_icon/listen/49.bin"; + static constexpr const char *TB_LISTEN_IMAGE_50 = APP_RES_PATH"/animated_icon/listen/50.bin"; + static constexpr const char *TB_LISTEN_IMAGE_51 = APP_RES_PATH"/animated_icon/listen/51.bin"; + static constexpr const char *TB_LISTEN_IMAGE_52 = APP_RES_PATH"/animated_icon/listen/52.bin"; + static constexpr const char *TB_LISTEN_IMAGE_53 = APP_RES_PATH"/animated_icon/listen/53.bin"; + static constexpr const char *TB_LISTEN_IMAGE_54 = APP_RES_PATH"/animated_icon/listen/54.bin"; + static constexpr const char *TB_LISTEN_IMAGE_55 = APP_RES_PATH"/animated_icon/listen/55.bin"; + static constexpr const char *TB_LISTEN_IMAGE_56 = APP_RES_PATH"/animated_icon/listen/56.bin"; + static constexpr const char *TB_LISTEN_IMAGE_57 = APP_RES_PATH"/animated_icon/listen/57.bin"; + static constexpr const char *TB_LISTEN_IMAGE_58 = APP_RES_PATH"/animated_icon/listen/58.bin"; + static constexpr const char *TB_LISTEN_IMAGE_59 = APP_RES_PATH"/animated_icon/listen/59.bin"; + static constexpr const char *TB_LISTEN_IMAGE_60 = APP_RES_PATH"/animated_icon/listen/60.bin"; + static constexpr const char *TB_LISTEN_IMAGE_61 = APP_RES_PATH"/animated_icon/listen/61.bin"; + static constexpr const char *TB_LISTEN_IMAGE_62 = APP_RES_PATH"/animated_icon/listen/62.bin"; + static constexpr const char *TB_LISTEN_IMAGE_63 = APP_RES_PATH"/animated_icon/listen/63.bin"; + static constexpr const char *TB_LISTEN_IMAGE_64 = APP_RES_PATH"/animated_icon/listen/64.bin"; + static constexpr const char *TB_LISTEN_IMAGE_65 = APP_RES_PATH"/animated_icon/listen/65.bin"; + static constexpr const char *TB_LISTEN_IMAGE_66 = APP_RES_PATH"/animated_icon/listen/66.bin"; + static constexpr const char *TB_LISTEN_IMAGE_67 = APP_RES_PATH"/animated_icon/listen/67.bin"; + static constexpr const char *TB_LISTEN_IMAGE_68 = APP_RES_PATH"/animated_icon/listen/68.bin"; + static constexpr const char *TB_LISTEN_IMAGE_69 = APP_RES_PATH"/animated_icon/listen/69.bin"; + static constexpr const char *TB_LISTEN_IMAGE_70 = APP_RES_PATH"/animated_icon/listen/70.bin"; + static constexpr const char *TB_LISTEN_IMAGE_71 = APP_RES_PATH"/animated_icon/listen/71.bin"; + static constexpr const char *TB_LISTEN_IMAGE_72 = APP_RES_PATH"/animated_icon/listen/72.bin"; + static constexpr const char *TB_LISTEN_IMAGE_73 = APP_RES_PATH"/animated_icon/listen/73.bin"; + static constexpr const char *TB_LISTEN_IMAGE_74 = APP_RES_PATH"/animated_icon/listen/74.bin"; + static constexpr const char *TB_LISTEN_IMAGE_75 = APP_RES_PATH"/animated_icon/listen/75.bin"; + static constexpr const char *TB_LISTEN_IMAGE_76 = APP_RES_PATH"/animated_icon/listen/76.bin"; + static constexpr const char *TB_LISTEN_IMAGE_77 = APP_RES_PATH"/animated_icon/listen/77.bin"; + static constexpr const char *TB_LISTEN_IMAGE_78 = APP_RES_PATH"/animated_icon/listen/78.bin"; + static constexpr const char *TB_LISTEN_IMAGE_79 = APP_RES_PATH"/animated_icon/listen/79.bin"; + static constexpr const char *TB_LISTEN_IMAGE_80 = APP_RES_PATH"/animated_icon/listen/80.bin"; + static constexpr const char *TB_LISTEN_IMAGE_81 = APP_RES_PATH"/animated_icon/listen/81.bin"; + static constexpr const char *TB_LISTEN_IMAGE_82 = APP_RES_PATH"/animated_icon/listen/82.bin"; + static constexpr const char *TB_LISTEN_IMAGE_83 = APP_RES_PATH"/animated_icon/listen/83.bin"; + static constexpr const char *TB_LISTEN_IMAGE_84 = APP_RES_PATH"/animated_icon/listen/84.bin"; + static constexpr const char *TB_LISTEN_IMAGE_85 = APP_RES_PATH"/animated_icon/listen/85.bin"; + static constexpr const char *TB_LISTEN_IMAGE_86 = APP_RES_PATH"/animated_icon/listen/86.bin"; + static constexpr const char *TB_LISTEN_IMAGE_87 = APP_RES_PATH"/animated_icon/listen/87.bin"; + static constexpr const char *TB_LISTEN_IMAGE_88 = APP_RES_PATH"/animated_icon/listen/88.bin"; + static constexpr const char *TB_LISTEN_IMAGE_89 = APP_RES_PATH"/animated_icon/listen/89.bin"; + static constexpr const char *TB_LISTEN_IMAGE_90 = APP_RES_PATH"/animated_icon/listen/90.bin"; + static constexpr const char *TB_LISTEN_IMAGE_91 = APP_RES_PATH"/animated_icon/listen/91.bin"; + static constexpr const char *TB_LISTEN_IMAGE_92 = APP_RES_PATH"/animated_icon/listen/92.bin"; + static constexpr const char *TB_LISTEN_IMAGE_93 = APP_RES_PATH"/animated_icon/listen/93.bin"; + static constexpr const char *TB_LISTEN_IMAGE_94 = APP_RES_PATH"/animated_icon/listen/94.bin"; + static constexpr const char *TB_LISTEN_IMAGE_95 = APP_RES_PATH"/animated_icon/listen/95.bin"; + + // Thunderbird shutdown 1..95 + static constexpr const char *TB_SHUTDOWN_IMAGE_1 = APP_RES_PATH"/RebootAndShutDown/ShutDown/1.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_2 = APP_RES_PATH"/RebootAndShutDown/ShutDown/2.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_3 = APP_RES_PATH"/RebootAndShutDown/ShutDown/3.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_4 = APP_RES_PATH"/RebootAndShutDown/ShutDown/4.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_5 = APP_RES_PATH"/RebootAndShutDown/ShutDown/5.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_6 = APP_RES_PATH"/RebootAndShutDown/ShutDown/6.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_7 = APP_RES_PATH"/RebootAndShutDown/ShutDown/7.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_8 = APP_RES_PATH"/RebootAndShutDown/ShutDown/8.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_9 = APP_RES_PATH"/RebootAndShutDown/ShutDown/9.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_10 = APP_RES_PATH"/RebootAndShutDown/ShutDown/10.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_11 = APP_RES_PATH"/RebootAndShutDown/ShutDown/11.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_12 = APP_RES_PATH"/RebootAndShutDown/ShutDown/12.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_13 = APP_RES_PATH"/RebootAndShutDown/ShutDown/13.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_14 = APP_RES_PATH"/RebootAndShutDown/ShutDown/14.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_15 = APP_RES_PATH"/RebootAndShutDown/ShutDown/15.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_16 = APP_RES_PATH"/RebootAndShutDown/ShutDown/16.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_17 = APP_RES_PATH"/RebootAndShutDown/ShutDown/17.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_18 = APP_RES_PATH"/RebootAndShutDown/ShutDown/18.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_19 = APP_RES_PATH"/RebootAndShutDown/ShutDown/19.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_20 = APP_RES_PATH"/RebootAndShutDown/ShutDown/20.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_21 = APP_RES_PATH"/RebootAndShutDown/ShutDown/21.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_22 = APP_RES_PATH"/RebootAndShutDown/ShutDown/22.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_23 = APP_RES_PATH"/RebootAndShutDown/ShutDown/23.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_24 = APP_RES_PATH"/RebootAndShutDown/ShutDown/24.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_25 = APP_RES_PATH"/RebootAndShutDown/ShutDown/25.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_26 = APP_RES_PATH"/RebootAndShutDown/ShutDown/26.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_27 = APP_RES_PATH"/RebootAndShutDown/ShutDown/27.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_28 = APP_RES_PATH"/RebootAndShutDown/ShutDown/28.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_29 = APP_RES_PATH"/RebootAndShutDown/ShutDown/29.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_30 = APP_RES_PATH"/RebootAndShutDown/ShutDown/30.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_31 = APP_RES_PATH"/RebootAndShutDown/ShutDown/31.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_32 = APP_RES_PATH"/RebootAndShutDown/ShutDown/32.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_33 = APP_RES_PATH"/RebootAndShutDown/ShutDown/33.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_34 = APP_RES_PATH"/RebootAndShutDown/ShutDown/34.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_35 = APP_RES_PATH"/RebootAndShutDown/ShutDown/35.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_36 = APP_RES_PATH"/RebootAndShutDown/ShutDown/36.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_37 = APP_RES_PATH"/RebootAndShutDown/ShutDown/37.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_38 = APP_RES_PATH"/RebootAndShutDown/ShutDown/38.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_39 = APP_RES_PATH"/RebootAndShutDown/ShutDown/39.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_40 = APP_RES_PATH"/RebootAndShutDown/ShutDown/40.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_41 = APP_RES_PATH"/RebootAndShutDown/ShutDown/41.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_42 = APP_RES_PATH"/RebootAndShutDown/ShutDown/42.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_43 = APP_RES_PATH"/RebootAndShutDown/ShutDown/43.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_44 = APP_RES_PATH"/RebootAndShutDown/ShutDown/44.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_45 = APP_RES_PATH"/RebootAndShutDown/ShutDown/45.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_46 = APP_RES_PATH"/RebootAndShutDown/ShutDown/46.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_47 = APP_RES_PATH"/RebootAndShutDown/ShutDown/47.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_48 = APP_RES_PATH"/RebootAndShutDown/ShutDown/48.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_49 = APP_RES_PATH"/RebootAndShutDown/ShutDown/49.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_50 = APP_RES_PATH"/RebootAndShutDown/ShutDown/50.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_51 = APP_RES_PATH"/RebootAndShutDown/ShutDown/51.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_52 = APP_RES_PATH"/RebootAndShutDown/ShutDown/52.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_53 = APP_RES_PATH"/RebootAndShutDown/ShutDown/53.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_54 = APP_RES_PATH"/RebootAndShutDown/ShutDown/54.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_55 = APP_RES_PATH"/RebootAndShutDown/ShutDown/55.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_56 = APP_RES_PATH"/RebootAndShutDown/ShutDown/56.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_57 = APP_RES_PATH"/RebootAndShutDown/ShutDown/57.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_58 = APP_RES_PATH"/RebootAndShutDown/ShutDown/58.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_59 = APP_RES_PATH"/RebootAndShutDown/ShutDown/59.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_60 = APP_RES_PATH"/RebootAndShutDown/ShutDown/60.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_61 = APP_RES_PATH"/RebootAndShutDown/ShutDown/61.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_62 = APP_RES_PATH"/RebootAndShutDown/ShutDown/62.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_63 = APP_RES_PATH"/RebootAndShutDown/ShutDown/63.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_64 = APP_RES_PATH"/RebootAndShutDown/ShutDown/64.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_65 = APP_RES_PATH"/RebootAndShutDown/ShutDown/65.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_66 = APP_RES_PATH"/RebootAndShutDown/ShutDown/66.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_67 = APP_RES_PATH"/RebootAndShutDown/ShutDown/67.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_68 = APP_RES_PATH"/RebootAndShutDown/ShutDown/68.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_69 = APP_RES_PATH"/RebootAndShutDown/ShutDown/69.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_70 = APP_RES_PATH"/RebootAndShutDown/ShutDown/70.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_71 = APP_RES_PATH"/RebootAndShutDown/ShutDown/71.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_72 = APP_RES_PATH"/RebootAndShutDown/ShutDown/72.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_73 = APP_RES_PATH"/RebootAndShutDown/ShutDown/73.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_74 = APP_RES_PATH"/RebootAndShutDown/ShutDown/74.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_75 = APP_RES_PATH"/RebootAndShutDown/ShutDown/75.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_76 = APP_RES_PATH"/RebootAndShutDown/ShutDown/76.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_77 = APP_RES_PATH"/RebootAndShutDown/ShutDown/77.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_78 = APP_RES_PATH"/RebootAndShutDown/ShutDown/78.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_79 = APP_RES_PATH"/RebootAndShutDown/ShutDown/79.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_80 = APP_RES_PATH"/RebootAndShutDown/ShutDown/80.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_81 = APP_RES_PATH"/RebootAndShutDown/ShutDown/81.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_82 = APP_RES_PATH"/RebootAndShutDown/ShutDown/82.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_83 = APP_RES_PATH"/RebootAndShutDown/ShutDown/83.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_84 = APP_RES_PATH"/RebootAndShutDown/ShutDown/84.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_85 = APP_RES_PATH"/RebootAndShutDown/ShutDown/85.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_86 = APP_RES_PATH"/RebootAndShutDown/ShutDown/86.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_87 = APP_RES_PATH"/RebootAndShutDown/ShutDown/87.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_88 = APP_RES_PATH"/RebootAndShutDown/ShutDown/88.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_89 = APP_RES_PATH"/RebootAndShutDown/ShutDown/89.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_90 = APP_RES_PATH"/RebootAndShutDown/ShutDown/90.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_91 = APP_RES_PATH"/RebootAndShutDown/ShutDown/91.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_92 = APP_RES_PATH"/RebootAndShutDown/ShutDown/92.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_93 = APP_RES_PATH"/RebootAndShutDown/ShutDown/93.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_94 = APP_RES_PATH"/RebootAndShutDown/ShutDown/94.bin"; + static constexpr const char *TB_SHUTDOWN_IMAGE_95 = APP_RES_PATH"/RebootAndShutDown/ShutDown/95.bin"; + + // Thunderbird naughty (test) 1..86 + static constexpr const char *TB_NAUGHTY_IMAGE_1 = APP_RES_PATH"/emoticon/naughty/1.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_2 = APP_RES_PATH"/emoticon/naughty/2.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_3 = APP_RES_PATH"/emoticon/naughty/3.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_4 = APP_RES_PATH"/emoticon/naughty/4.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_5 = APP_RES_PATH"/emoticon/naughty/5.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_6 = APP_RES_PATH"/emoticon/naughty/6.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_7 = APP_RES_PATH"/emoticon/naughty/7.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_8 = APP_RES_PATH"/emoticon/naughty/8.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_9 = APP_RES_PATH"/emoticon/naughty/9.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_10 = APP_RES_PATH"/emoticon/naughty/10.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_11 = APP_RES_PATH"/emoticon/naughty/11.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_12 = APP_RES_PATH"/emoticon/naughty/12.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_13 = APP_RES_PATH"/emoticon/naughty/13.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_14 = APP_RES_PATH"/emoticon/naughty/14.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_15 = APP_RES_PATH"/emoticon/naughty/15.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_16 = APP_RES_PATH"/emoticon/naughty/16.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_17 = APP_RES_PATH"/emoticon/naughty/17.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_18 = APP_RES_PATH"/emoticon/naughty/18.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_19 = APP_RES_PATH"/emoticon/naughty/19.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_20 = APP_RES_PATH"/emoticon/naughty/20.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_21 = APP_RES_PATH"/emoticon/naughty/21.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_22 = APP_RES_PATH"/emoticon/naughty/22.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_23 = APP_RES_PATH"/emoticon/naughty/23.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_24 = APP_RES_PATH"/emoticon/naughty/24.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_25 = APP_RES_PATH"/emoticon/naughty/25.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_26 = APP_RES_PATH"/emoticon/naughty/26.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_27 = APP_RES_PATH"/emoticon/naughty/27.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_28 = APP_RES_PATH"/emoticon/naughty/28.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_29 = APP_RES_PATH"/emoticon/naughty/29.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_30 = APP_RES_PATH"/emoticon/naughty/30.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_31 = APP_RES_PATH"/emoticon/naughty/31.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_32 = APP_RES_PATH"/emoticon/naughty/32.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_33 = APP_RES_PATH"/emoticon/naughty/33.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_34 = APP_RES_PATH"/emoticon/naughty/34.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_35 = APP_RES_PATH"/emoticon/naughty/35.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_36 = APP_RES_PATH"/emoticon/naughty/36.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_37 = APP_RES_PATH"/emoticon/naughty/37.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_38 = APP_RES_PATH"/emoticon/naughty/38.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_39 = APP_RES_PATH"/emoticon/naughty/39.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_40 = APP_RES_PATH"/emoticon/naughty/40.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_41 = APP_RES_PATH"/emoticon/naughty/41.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_42 = APP_RES_PATH"/emoticon/naughty/42.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_43 = APP_RES_PATH"/emoticon/naughty/43.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_44 = APP_RES_PATH"/emoticon/naughty/44.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_45 = APP_RES_PATH"/emoticon/naughty/45.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_46 = APP_RES_PATH"/emoticon/naughty/46.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_47 = APP_RES_PATH"/emoticon/naughty/47.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_48 = APP_RES_PATH"/emoticon/naughty/48.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_49 = APP_RES_PATH"/emoticon/naughty/49.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_50 = APP_RES_PATH"/emoticon/naughty/50.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_51 = APP_RES_PATH"/emoticon/naughty/51.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_52 = APP_RES_PATH"/emoticon/naughty/52.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_53 = APP_RES_PATH"/emoticon/naughty/53.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_54 = APP_RES_PATH"/emoticon/naughty/54.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_55 = APP_RES_PATH"/emoticon/naughty/55.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_56 = APP_RES_PATH"/emoticon/naughty/56.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_57 = APP_RES_PATH"/emoticon/naughty/57.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_58 = APP_RES_PATH"/emoticon/naughty/58.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_59 = APP_RES_PATH"/emoticon/naughty/59.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_60 = APP_RES_PATH"/emoticon/naughty/60.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_61 = APP_RES_PATH"/emoticon/naughty/61.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_62 = APP_RES_PATH"/emoticon/naughty/62.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_63 = APP_RES_PATH"/emoticon/naughty/63.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_64 = APP_RES_PATH"/emoticon/naughty/64.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_65 = APP_RES_PATH"/emoticon/naughty/65.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_66 = APP_RES_PATH"/emoticon/naughty/66.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_67 = APP_RES_PATH"/emoticon/naughty/67.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_68 = APP_RES_PATH"/emoticon/naughty/68.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_69 = APP_RES_PATH"/emoticon/naughty/69.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_70 = APP_RES_PATH"/emoticon/naughty/70.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_71 = APP_RES_PATH"/emoticon/naughty/71.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_72 = APP_RES_PATH"/emoticon/naughty/72.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_73 = APP_RES_PATH"/emoticon/naughty/73.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_74 = APP_RES_PATH"/emoticon/naughty/74.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_75 = APP_RES_PATH"/emoticon/naughty/75.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_76 = APP_RES_PATH"/emoticon/naughty/76.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_77 = APP_RES_PATH"/emoticon/naughty/77.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_78 = APP_RES_PATH"/emoticon/naughty/78.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_79 = APP_RES_PATH"/emoticon/naughty/79.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_80 = APP_RES_PATH"/emoticon/naughty/80.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_81 = APP_RES_PATH"/emoticon/naughty/81.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_82 = APP_RES_PATH"/emoticon/naughty/82.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_83 = APP_RES_PATH"/emoticon/naughty/83.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_84 = APP_RES_PATH"/emoticon/naughty/84.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_85 = APP_RES_PATH"/emoticon/naughty/85.bin"; + static constexpr const char *TB_NAUGHTY_IMAGE_86 = APP_RES_PATH"/emoticon/naughty/86.bin"; + + + + // AppList static constexpr const char *PNG_APPLIST_ALARM_IMAGE = APP_RES_PATH"/APPLIST_ALARM.bin"; // 闹钟 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdAdjustView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdAdjustView.h similarity index 61% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdAdjustView.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdAdjustView.h index 87a3eec41..c367bd2d9 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdAdjustView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdAdjustView.h @@ -5,15 +5,25 @@ #include "components/ui_view_group.h" #include "components/ui_label_ext.h" #include "components/ui_image_view.h" +#include "components/ui_image_animator.h" namespace OHOS { + static constexpr int16_t TB_NET_ANIM_X = 38; + static constexpr int16_t TB_NET_ANIM_Y = 151; + static constexpr int16_t TB_NET_ANIM_W = 36; + static constexpr int16_t TB_NET_ANIM_H = 36; + static constexpr int16_t TB_NET_ANIM_FRAMES = 60; + static constexpr int16_t TB_NET_ANIM_INTERVAL = 41; + static constexpr const char *TB_NET_ANIM_PATH = "/user/res/animated_icon/net/"; + class ThunderBirdAdjustView { public: ThunderBirdAdjustView(); virtual ~ThunderBirdAdjustView(); static ThunderBirdAdjustView *GetInstance(void); + bool EnsureNetAnimator(); UIViewGroup *ThunderBirdAdjustViewInit(void); void ClearAll(void); void Show(int16_t showView); @@ -26,12 +36,15 @@ namespace OHOS private: UIViewGroup *group{nullptr}; - UILabelExt *titleLabel{nullptr}; UILabelExt *TextLabel{nullptr}; + UIImageAnimatorView *netAnimator{nullptr}; + ImageAnimatorInfo netImageInfo[TB_NET_ANIM_FRAMES]; + const char **netPathsArray{nullptr}; UILabelExt *RemindLabel{nullptr}; + UIImageView *BackGround{nullptr}; UIImageView *RemindIcon{nullptr}; UIImageView *RemindIcon2{nullptr}; - UIImageView *BackGround{nullptr}; + UIImageView *RemindIcon3{nullptr}; }; } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h new file mode 100644 index 000000000..040d3a2f7 --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h @@ -0,0 +1,59 @@ +#ifndef THUNDERBIRD_DIALOGUE_VIEW_H_ +#define THUNDERBIRD_DIALOGUE_VIEW_H_ + +#include "View.h" +#include "components/ui_view_group.h" +#include "components/ui_label_ext.h" +#include "components/ui_image_view.h" +#include "components/ui_image_animator.h" + +namespace OHOS +{ + static constexpr int16_t TB_SPEAK_ANIM_X = 141; + static constexpr int16_t TB_SPEAK_ANIM_Y = 114; + static constexpr int16_t TB_SPEAK_ANIM_W = 78; + static constexpr int16_t TB_SPEAK_ANIM_H = 24; + static constexpr int16_t TB_SPEAK_ANIM_FRAMES = 25; + static constexpr int16_t TB_SPEAK_ANIM_INTERVAL = 41; + static constexpr const char *TB_SPEAK_ANIM_PATH = "/user/res/animated_icon/speak/"; + + static constexpr int16_t TB_LISTEN_ANIM_X = 69; + static constexpr int16_t TB_LISTEN_ANIM_Y = 67; + static constexpr int16_t TB_LISTEN_ANIM_W = 36; + static constexpr int16_t TB_LISTEN_ANIM_H = 36; + static constexpr int16_t TB_LISTEN_ANIM_FRAMES = 61; + static constexpr int16_t TB_LISTEN_ANIM_INTERVAL = 41; + static constexpr const char *TB_LISTEN_ANIM_PATH = "/user/res/animated_icon/listen/"; + + class ThunderBirdDialogueView + { + public: + ThunderBirdDialogueView(); + virtual ~ThunderBirdDialogueView(); + static ThunderBirdDialogueView *GetInstance(void); + UIViewGroup *ThunderBirdDialogueViewInit(void); + bool EnsureSpeakAnimator(); + bool EnsureListenAnimator(); + void ClearAll(void); + void Show(int16_t showView); + + enum : int16_t { + THUNDERBIRD_DIALOGUEVIEW_SPEAKING = 0, // 说话中 + THUNDERBIRD_DIALOGUEVIEW_LISTENING, // 聆听中 + THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW, // 状态展示 + }; + + private: + UIViewGroup *group{nullptr}; + UILabelExt *TextLabel{nullptr}; + UIImageAnimatorView *speakAnimator{nullptr}; + UIImageAnimatorView *listenAnimator{nullptr}; + ImageAnimatorInfo speakImageInfo[TB_SPEAK_ANIM_FRAMES]; + ImageAnimatorInfo listenImageInfo[TB_LISTEN_ANIM_FRAMES]; + const char **speakPathsArray{nullptr}; + const char **listenPathsArray{nullptr}; + }; +} + +#endif + diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdGuideView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdGuideView.h similarity index 91% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdGuideView.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdGuideView.h index cf04f0121..dc49d7097 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdGuideView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdGuideView.h @@ -5,6 +5,7 @@ #include "components/ui_view_group.h" #include "components/ui_label_ext.h" #include "components/ui_image_view.h" +#include "components/ui_label_button.h" namespace OHOS { @@ -26,13 +27,12 @@ namespace OHOS private: UIViewGroup *group{nullptr}; - UILabelExt *titleLabel{nullptr}; UILabelExt *TextLabel{nullptr}; + UILabelButton *RemindButton{nullptr}; UILabelExt *RemindLabel{nullptr}; UIImageView *RemindGround{nullptr}; UIImageView *RemindIcon{nullptr}; UIImageView *RemindIcon2{nullptr}; - UIImageView *BackGround{nullptr}; }; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h similarity index 58% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h index 14a632b7b..1e51044e0 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h @@ -5,9 +5,19 @@ #include "components/ui_view_group.h" #include "components/ui_label_ext.h" #include "components/ui_image_view.h" +#include "components/ui_image_animator.h" +#include namespace OHOS { + static constexpr int16_t TB_LISTEN_X = 38; + static constexpr int16_t TB_LISTEN_Y = 151; + static constexpr int16_t TB_LISTEN_W = 36; + static constexpr int16_t TB_LISTEN_H = 36; + static constexpr int16_t TB_LISTEN_FRAMES = 95; + static constexpr int16_t TB_LISTEN_INTERVAL = 41; + static constexpr const char *TB_LISTEN_PATH = "/user/res/animated_icon/listen/"; + class ThunderBirdLullabyView { public: @@ -15,8 +25,10 @@ namespace OHOS virtual ~ThunderBirdLullabyView(); static ThunderBirdLullabyView *GetInstance(void); UIViewGroup *ThunderBirdLullabyViewInit(void); + bool EnsureListenAnimator(); void ClearAll(void); void Show(int16_t showView); + void UpdateTimeText(uint32_t currentSeconds, uint32_t totalSeconds); enum : int16_t { THUNDERBIRD_LULLABYVIEW_1 = 0, @@ -28,12 +40,13 @@ namespace OHOS private: UIViewGroup *group{nullptr}; - UILabelExt *titleLabel{nullptr}; UILabelExt *TextLabel{nullptr}; UILabelExt *RemindLabel{nullptr}; UIImageView *RemindIcon{nullptr}; UIImageView *RemindIcon2{nullptr}; - UIImageView *BackGround{nullptr}; + UIImageAnimatorView *listenAnimator{nullptr}; + ImageAnimatorInfo listenImageInfo[TB_LISTEN_FRAMES]; + const char **listenPathsArray{nullptr}; }; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h similarity index 78% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h index c1c1142c7..685d3ade7 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h @@ -8,20 +8,21 @@ #include "components/ui_label_ext.h" #include "components/ui_image_view.h" #include "video_play_wrapper.h" -#include "main/include/dial/DialVideoView.h" +#include "main/dial/DialVideoView.h" #include "animator/animator_manager.h" #include "components/ui_box_progress.h" #include "components/ui_image_animator.h" #include "thunderbird/include/ThunderBirdModel.h" #include "thunderbird/include/ThunderBirdPresenter.h" // 各子界面头文件 -#include "thunderbird/include/ThunderBirdView.h" #include "thunderbird/include/ThunderBirdOtaView.h" #include "thunderbird/include/ThunderBirdGuideView.h" #include "thunderbird/include/ThunderBirdLullabyView.h" #include "thunderbird/include/ThunderBirdDialogueView.h" #include "thunderbird/include/ThunderBirdReminderView.h" #include "thunderbird/include/ThunderBirdAdjustView.h" +#include "thunderbird/include/ThunderBirdShutdownView.h" +#include "thunderbird/include/ThunderBirdShutdownTestView.h" namespace OHOS { static constexpr const char *DROPDOWN_NOSIGNAL_IMAGE = "/user/res/DROPDOWN_NOSIGNAL.bin"; @@ -36,6 +37,7 @@ namespace OHOS THUNDERBIRD_REMINDERVIEW, THUNDERBIRD_ADJUSTVIEW, THUNDERBIRD_SHUTDOWNVIEW, + THUNDERBIRD_SHUTDOWNTESTVIEW, MAXVIEW } BPVIEWID; @@ -57,24 +59,43 @@ namespace OHOS bool ChangeThunderBirdReminderView(int16_t); bool ChangeThunderBirdAdjustView(int16_t); bool ChangeThunderBirdShutdownView(int16_t); + bool ChangeThunderBirdShutdownTestView(int16_t); bool ClickFunc(int16_t interface); void ChangeView(int16_t hideView, int16_t showView, int16_t subView = -1); + int16_t GetPrevViewId() const { return prevView_; } + int16_t GetPrevSubViewId() const { return prevSubView_; } int16_t GetCurrentView() const; int16_t GetCurrentSubView() const; + void UpdateBatteryProcess(); void updateSignalDisplay(); void UpdateSignalBarDisplay(int signalBars, bool state); int CalculateSignalBars(int signalStrength); void UpdateTimeText(const char *time); void Initback(); - void InitBaseData(); + UIViewGroup * InitBaseData(); void InitCommonPageComponents(); void HideCommonPageComponents(); bool SwitchVideo(const char *uri); // 关机前关闭视频与相关资源 void CloseVideo(); + // 打开遮罩(部分视图需要) + void OpenBackGround(void); + + MediaVideoPlay *video_ = nullptr; + MediaVideoPlay *videoPlay_ = nullptr; + UIImageView *batteryimage{nullptr}; // 电池图片 + UILabel *batteryLabel{nullptr}; // 电池电量 + UIBoxProgress *progress{nullptr}; // 电池进度条 + UIImageView *chargeBatteryicon{nullptr}; // 充电图标 + bool isChargeBatteryIconVisible{false}; // 充电图标是否可见 + + int16_t Batteryvalue{0}; // 电池电量 + + UIImageView *iconView{nullptr}; + UIImageView *backGroundView{nullptr}; private: @@ -86,35 +107,39 @@ namespace OHOS UIViewGroup *pagesGroup{nullptr}; int16_t currentView_{THUNDERBIRD_GUIDEVIEW}; int16_t currentSubView_{0}; - + int16_t prevView_{THUNDERBIRDMENUVIEW}; + int16_t prevSubView_{0}; + // 网络状态变化标志(-1 未初始化,0 无网络,1 有网络) + int8_t lastNetworkOnline_{-1}; UIImageView *curFace{nullptr}; DialVideoView *videoPlayer_ = nullptr; UILiteSurfaceView *surfaceView_ = nullptr; - MediaVideoPlay *video_ = nullptr; - MediaVideoPlay *videoPlay_ = nullptr; + ColorType colorKey_; UIViewGroup *group1{nullptr}; UILabelExt *timeLabel{nullptr}; UIImageView *showSignalStrength[4]{nullptr}; // 信号强度 UIImageView *NoSignal{nullptr}; // 无信号 - UIImageView *batteryimage{nullptr}; // 电池图片 - UILabel *batteryLabel{nullptr}; // 电池电量 - UIBoxProgress *progress{nullptr}; // 电池进度条 - UIImageView *chargeBatteryicon{nullptr}; // 充电图标 - bool isChargeBatteryIconVisible{false}; // 充电图标是否可见 + // Ota(进度/文本) UIBoxProgress *otaProgress{nullptr}; + // 电量提醒与充电状态一次性提示控制 + int16_t lastBatteryStage{-1}; // 3:>20, 2:(10,20], 1:(5,10], 0:<=5 + bool wasCharging{false}; + bool notifiedChargeFull{false}; + // 各子界面对象指针 - ThunderBirdView *g_pThunderBirdView{nullptr}; ThunderBirdOtaView *g_pThunderBirdOtaView{nullptr}; ThunderBirdGuideView *g_pThunderBirdGuideView{nullptr}; ThunderBirdLullabyView *g_pThunderBirdLullabyView{nullptr}; ThunderBirdDialogueView *g_pThunderBirdDialogueView{nullptr}; ThunderBirdReminderView *g_pThunderBirdReminderView{nullptr}; ThunderBirdAdjustView *g_pThunderBirdAdjustView{nullptr}; + ThunderBirdShutdownView *g_pThunderBirdShutdownView{nullptr}; + ThunderBirdShutdownTestView *g_pThunderBirdShutdownTestView{nullptr}; #define SCREEN_WIDTH (Screen::GetInstance().GetWidth()) #define SCREEN_HEIGHT (Screen::GetInstance().GetHeight()) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h similarity index 71% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h index a2f9e12be..30689084a 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h @@ -18,6 +18,11 @@ namespace OHOS void timer_callback_proc(); void StopTimer(void); void StartTimer(uint32_t interval = 2 * 1000);//2秒 + void StartReminderHideTimer(uint32_t intervalMs = 1000); + void StartOtaCountdown(uint32_t startVal); + void StartCountUpTimer(uint32_t targetSeconds); + void StopCountUpTimer(void); + int GetCountUpValue() const; private: ThunderBirdModel(); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdOtaView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdOtaView.h similarity index 73% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdOtaView.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdOtaView.h index 419648321..ca82f2b09 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdOtaView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdOtaView.h @@ -5,6 +5,7 @@ #include "components/ui_view_group.h" #include "components/ui_label_ext.h" #include "components/ui_image_view.h" +#include "components/ui_box_progress.h" namespace OHOS { @@ -17,11 +18,13 @@ namespace OHOS UIViewGroup *ThunderBirdOtaViewInit(void); void ClearAll(void); void Show(int16_t showView); - + void UpdateCountdown(int value); + void SetRemindProgress(int16_t value); enum : int16_t { - THUNDERBIRD_OTAVIEW_READY = 0, // OTA就绪 - THUNDERBIRD_OTAVIEW_NEW_FEATURE, // 有新功能 + THUNDERBIRD_OTAVIEW_NORMAL = 0, // OTA就绪 + THUNDERBIRD_OTAVIEW_OBVIOUS, // 有新功能 THUNDERBIRD_OTAVIEW_UPDATE_NOW, // 需要立即更新 + THUNDERBIRD_OTAVIEW_UPDATING, // 更新中 THUNDERBIRD_OTAVIEW_NIGHT_UPDATE, // 设置夜间更新 THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS, // 设置夜间更新成功 THUNDERBIRD_OTAVIEW_COUNTDOWN, // 更新倒计时 @@ -36,10 +39,15 @@ namespace OHOS UIViewGroup *group{nullptr}; UILabelExt *titleLabel{nullptr}; UILabelExt *TextLabel{nullptr}; + UILabelExt *LittleTextLabel{nullptr}; + UILabelExt *LittleTextLabel_2{nullptr}; UILabelExt *RemindLabel{nullptr}; UIImageView *RemindIcon{nullptr}; UIImageView *RemindIcon2{nullptr}; + UIImageView *RemindIcon3{nullptr}; + UIBoxProgress *VolumeProgress{nullptr}; UIImageView *BackGround{nullptr}; + int16_t remindProgressValue_{0}; }; } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h similarity index 93% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h index 65b5e3f2f..0845de704 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h @@ -3,7 +3,7 @@ #define THUNDERBIRD_PRESENTER_H #include "thunderbird/include/ThunderBirdMainView.h" -#include "key/include/KeyInputListener.h" +#include "key/KeyInputListener.h" #include "Presenter.h" #include "View.h" @@ -20,6 +20,7 @@ namespace OHOS virtual ~ThunderBirdPresenter(); void OnStart() override; + void OnResume() override; static ThunderBirdPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h similarity index 60% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h index 2ae65e6be..16b7f9ddf 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdReminderView.h @@ -5,6 +5,8 @@ #include "components/ui_view_group.h" #include "components/ui_label_ext.h" #include "components/ui_image_view.h" +#include "components/ui_box_progress.h" +#include "components/ui_label_button.h" namespace OHOS { @@ -17,6 +19,10 @@ namespace OHOS UIViewGroup *ThunderBirdReminderViewInit(void); void ClearAll(void); void Show(int16_t showView); + void HideAll(); + // 音量/进度调节接口(用于 THUNDERBIRD_REMINDERVIEW_VOLUME) + void AdjustRemindProgress(int16_t delta); // 正数增加,负数减少 + void SetRemindProgress(int16_t value); enum : int16_t { THUNDERBIRD_REMINDERVIEW_VOLUME = 0, // 音量调节 @@ -25,16 +31,24 @@ namespace OHOS THUNDERBIRD_REMINDERVIEW_LOW_BATTERY, // 电量不足 THUNDERBIRD_REMINDERVIEW_CHARGING, // 充电中 THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE, // 充电完成 + THUNDERBIRD_REMINDERVIEW_DIALOGUE_NOT_ENOUGH,//对话不足 + THUNDERBIRD_REMINDERVIEW_DIALOGUE_USE_UP, //对话用尽 + THUNDERBIRD_REMINDERVIEW_FLOW_NOT_ENOUGH, //流量不足 + THUNDERBIRD_REMINDERVIEW_FLOW_USE_UP, //流量用尽 }; private: UIViewGroup *group{nullptr}; - UILabelExt *titleLabel{nullptr}; UILabelExt *TextLabel{nullptr}; UILabelExt *RemindLabel{nullptr}; + UILabelButton *RemindButton{nullptr}; UIImageView *RemindIcon{nullptr}; UIImageView *RemindIcon2{nullptr}; - UIImageView *BackGround{nullptr}; + + UIBoxProgress *VolumeProgress{nullptr}; + + // 进度当前值(用于音量界面),0~100 + int16_t remindProgressValue_{50}; }; } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownTestView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownTestView.h new file mode 100644 index 000000000..f22afa421 --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownTestView.h @@ -0,0 +1,45 @@ +#ifndef THUNDERBIRD_SHUTDOWN_TEST_VIEW_H +#define THUNDERBIRD_SHUTDOWN_TEST_VIEW_H + +#include "components/ui_view_group.h" +#include "components/ui_image_animator.h" + +namespace OHOS +{ + static constexpr int16_t TB_SHUTDOWN_ANIM_X_TEST = 0; + static constexpr int16_t TB_SHUTDOWN_ANIM_Y_TEST = 0; + static constexpr int16_t TB_SHUTDOWN_ANIM_W_TEST = 466; + static constexpr int16_t TB_SHUTDOWN_ANIM_H_TEST = 466; + static constexpr int16_t TB_SHUTDOWN_ANIM_FRAMES_TEST = 86; + static constexpr int16_t TB_SHUTDOWN_ANIM_INTERVAL_TEST = 41; + static constexpr const char *TB_SHUTDOWN_ANIM_PATH_TEST = "/user/res/emoticon/naughty"; + class ThunderBirdShutdownTestView : public UIImageAnimatorView::AnimatorStopListener + { + public: + ThunderBirdShutdownTestView(); + virtual ~ThunderBirdShutdownTestView(); + + static ThunderBirdShutdownTestView *GetInstance(); + + UIViewGroup *Init(); + UIImageAnimatorView *GetAnimator(); + + void StartAnimation(); + + private: + void OnAnimatorStop(UIView &view) override; + void ClearAll(); + bool EnsureAnimator(); + + private: + UIViewGroup *group{nullptr}; + UIImageAnimatorView *animator{nullptr}; + ImageAnimatorInfo imageInfos[TB_SHUTDOWN_ANIM_FRAMES_TEST]; + UIImageView *iconView{nullptr}; + const char **pathsArray{nullptr}; + }; +} + +#endif + + diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownView.h similarity index 95% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownView.h rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownView.h index f9a9e2c1e..e48c93fbe 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdShutdownView.h @@ -11,7 +11,7 @@ namespace OHOS static constexpr int16_t TB_SHUTDOWN_ANIM_W = 466; static constexpr int16_t TB_SHUTDOWN_ANIM_H = 466; static constexpr int16_t TB_SHUTDOWN_ANIM_FRAMES = 95; - static constexpr int16_t TB_SHUTDOWN_ANIM_INTERVAL = 150; + static constexpr int16_t TB_SHUTDOWN_ANIM_INTERVAL = 41; static constexpr const char *TB_SHUTDOWN_ANIM_PATH = "/user/res/RebootAndShutDown/ShutDown/"; class ThunderBirdShutdownView : public UIImageAnimatorView::AnimatorStopListener diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp new file mode 100644 index 000000000..b8dee2f12 --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdAdjustView.cpp @@ -0,0 +1,242 @@ +#include "thunderbird/include/ThunderBirdAdjustView.h" +#include "wearable_log.h" +#include "common/image_cache_manager.h" +#include "UiConfig.h" + +namespace OHOS +{ + const char *searchImagePath[TB_NET_ANIM_FRAMES] = { + PNG_A019_080_IMAGE_PATH, + PNG_A019_081_IMAGE_PATH, + PNG_A019_082_IMAGE_PATH, + PNG_A019_083_IMAGE_PATH, + PNG_A019_084_IMAGE_PATH, + PNG_A019_085_IMAGE_PATH, + PNG_A019_086_IMAGE_PATH, + PNG_A019_087_IMAGE_PATH, + }; + static ThunderBirdAdjustView *g_pThunderBirdAdjustView{nullptr}; + + ThunderBirdAdjustView::ThunderBirdAdjustView() + { + g_pThunderBirdAdjustView = this; + } + + ThunderBirdAdjustView::~ThunderBirdAdjustView() + { + g_pThunderBirdAdjustView = nullptr; + ClearAll(); + } + + ThunderBirdAdjustView *ThunderBirdAdjustView::GetInstance(void) + { + return g_pThunderBirdAdjustView; + } + + void ThunderBirdAdjustView::ClearAll(void) + { + if (group != nullptr) + { + group->RemoveAll(); + delete group; + group = nullptr; + } + if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } + if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } + if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } + if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } + if (RemindIcon3 != nullptr) { delete RemindIcon3; RemindIcon3 = nullptr; } + if (netAnimator != nullptr) { delete netAnimator; netAnimator = nullptr; } + if (BackGround != nullptr) { delete BackGround; BackGround = nullptr; } + } + + bool ThunderBirdAdjustView::EnsureNetAnimator() + { + if (netAnimator == nullptr) + { + netPathsArray = searchImagePath; + netAnimator = new UIImageAnimatorView(); + if (netAnimator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView new UIImageAnimatorView fail"); + return false; + } + netAnimator->SetAutoEnable(false); + for (uint8_t i = 0; i < TB_NET_ANIM_FRAMES; i++) + { + netImageInfo[i].imagePath = (netPathsArray[i]); + netImageInfo[i].imageType = IMG_SRC_FILE_PATH; + netImageInfo[i].pos.x = TB_NET_ANIM_X; + netImageInfo[i].pos.y = TB_NET_ANIM_Y; + netImageInfo[i].width = TB_NET_ANIM_W; + netImageInfo[i].height = TB_NET_ANIM_H; + } + netAnimator->SetPosition(TB_NET_ANIM_X, TB_NET_ANIM_Y, TB_NET_ANIM_W, TB_NET_ANIM_H); + netAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + netAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + netAnimator->SetImageAnimatorSrc(netImageInfo, TB_NET_ANIM_FRAMES, TB_NET_ANIM_INTERVAL); + netAnimator->SetRepeat(true); + netAnimator->SetResizeMode(UIImageView::COVER); + //netAnimator->SetAnimatorStopListener(this); + } + return true; + } + + UIViewGroup *ThunderBirdAdjustView::ThunderBirdAdjustViewInit(void) + { + group = new UIViewGroup(); + if (group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdAdjustView::group null!"); + return nullptr; + } + group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + + // 公共控件 + BackGround = new UIImageView(); + if (BackGround) + { + BackGround->SetAutoEnable(false); + BackGround->SetPosition(0, 0, 360, 360); + BackGround->SetSrc("/user/res/RebootAndShutDown/ReBoot/4.bin"); + BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + BackGround->SetResizeMode(UIImageView::CONTAIN); + BackGround->SetVisible(true); + group->Add(BackGround); + } + if(!EnsureNetAnimator()) + { + return nullptr; + } + group->Add(netAnimator); + TextLabel = new UILabelExt(); + if (TextLabel) + { + TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); + TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + TextLabel->SetVisible(false); + group->Add(TextLabel); + } + RemindIcon = new UIImageView(); + if (RemindIcon) + { + RemindIcon->SetAutoEnable(false); + RemindIcon->SetVisible(false); + group->Add(RemindIcon); + } + RemindIcon2 = new UIImageView(); + if (RemindIcon2) + { + RemindIcon2->SetAutoEnable(false); + RemindIcon2->SetVisible(false); + group->Add(RemindIcon2); + } + RemindIcon3 = new UIImageView(); + if (RemindIcon3) + { + RemindIcon3->SetAutoEnable(false); + RemindIcon3->SetVisible(false); + group->Add(RemindIcon3); + } + RemindLabel = new UILabelExt(); + if (RemindLabel) + { + RemindLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); + RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + RemindLabel->SetVisible(false); + group->Add(RemindLabel); + } + return group; + } + + void ThunderBirdAdjustView::Show(int16_t showView) + { + if (group == nullptr) { return; } + if (TextLabel) { TextLabel->SetVisible(false);} + if (RemindLabel) { RemindLabel->SetVisible(false);} + if (RemindIcon) { RemindIcon->SetVisible(false); } + if (RemindIcon2) { RemindIcon2->SetVisible(false); } + if (RemindIcon3) { RemindIcon3->SetVisible(false); } + if (netAnimator) { netAnimator->SetVisible(false); netAnimator->Stop(); } + switch (showView) + { + case THUNDERBIRD_ADJUSTVIEW_BIND_SUCCESS: + { + if (TextLabel) + { + TextLabel->SetPosition(142, 148, 120, 42); + TextLabel->SetText("绑定成功"); + TextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(132, 284, 96, 28); + RemindLabel->SetText("按 确认"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(98, 151, 36, 36); + RemindIcon->SetSrc("/user/res/completed.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(158, 286, 24, 24); + RemindIcon2->SetSrc("/user/res/completed.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_ADJUSTVIEW_WARNING: + { + if (TextLabel) + { + TextLabel->SetPosition(112, 148, 180, 42); + TextLabel->SetText("网络连接失败"); + TextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 重试"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(68, 151, 36, 36); + RemindIcon->SetSrc("/user/res/warning.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(104, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_down.bin"); + RemindIcon2->SetVisible(true); + } + if (RemindIcon3) + { + RemindIcon3->SetPosition(216, 277, 22, 22); + RemindIcon3->SetSrc("/user/res/volume_up.bin"); + RemindIcon3->SetVisible(true); + } + break; + } + case THUNDERBIRD_ADJUSTVIEW_NETWORK_CONNECTING: + { + if (TextLabel) + { + TextLabel->SetPosition(82, 148, 240, 42); + TextLabel->SetText("正在重新连接网络"); + TextLabel->SetVisible(true); + } + if (netAnimator) { netAnimator->SetVisible(true); netAnimator->Start(); } + break; + } + default: + break; + } + } +} + + diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp new file mode 100644 index 000000000..bd5d74d85 --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp @@ -0,0 +1,274 @@ +#include "thunderbird/include/ThunderBirdDialogueView.h" +#include "wearable_log.h" +#include "UiConfig.h" + +namespace OHOS +{ + static ThunderBirdDialogueView *g_pThunderBirdDialogueView{nullptr}; + static const char *TB_SPEAK_PATHS[TB_SPEAK_ANIM_FRAMES] = { + TB_SPEAK_IMAGE_1, + TB_SPEAK_IMAGE_2, + TB_SPEAK_IMAGE_3, + TB_SPEAK_IMAGE_4, + TB_SPEAK_IMAGE_5, + TB_SPEAK_IMAGE_6, + TB_SPEAK_IMAGE_7, + TB_SPEAK_IMAGE_8, + TB_SPEAK_IMAGE_9, + TB_SPEAK_IMAGE_10, + TB_SPEAK_IMAGE_11, + TB_SPEAK_IMAGE_12, + TB_SPEAK_IMAGE_13, + TB_SPEAK_IMAGE_14, + TB_SPEAK_IMAGE_15, + TB_SPEAK_IMAGE_16, + TB_SPEAK_IMAGE_17, + TB_SPEAK_IMAGE_18, + TB_SPEAK_IMAGE_19, + TB_SPEAK_IMAGE_20, + TB_SPEAK_IMAGE_21, + TB_SPEAK_IMAGE_22, + TB_SPEAK_IMAGE_23, + TB_SPEAK_IMAGE_24, + TB_SPEAK_IMAGE_25, + }; + static const char *TB_LISTEN_PATHS[TB_LISTEN_ANIM_FRAMES] = { + TB_LISTEN_IMAGE_1, + TB_LISTEN_IMAGE_2, + TB_LISTEN_IMAGE_3, + TB_LISTEN_IMAGE_4, + TB_LISTEN_IMAGE_5, + TB_LISTEN_IMAGE_6, + TB_LISTEN_IMAGE_7, + TB_LISTEN_IMAGE_8, + TB_LISTEN_IMAGE_9, + TB_LISTEN_IMAGE_10, + TB_LISTEN_IMAGE_11, + TB_LISTEN_IMAGE_12, + TB_LISTEN_IMAGE_13, + TB_LISTEN_IMAGE_14, + TB_LISTEN_IMAGE_15, + TB_LISTEN_IMAGE_16, + TB_LISTEN_IMAGE_17, + TB_LISTEN_IMAGE_18, + TB_LISTEN_IMAGE_19, + TB_LISTEN_IMAGE_20, + TB_LISTEN_IMAGE_21, + TB_LISTEN_IMAGE_22, + TB_LISTEN_IMAGE_23, + TB_LISTEN_IMAGE_24, + TB_LISTEN_IMAGE_25, + TB_LISTEN_IMAGE_26, + TB_LISTEN_IMAGE_27, + TB_LISTEN_IMAGE_28, + TB_LISTEN_IMAGE_29, + TB_LISTEN_IMAGE_30, + TB_LISTEN_IMAGE_31, + TB_LISTEN_IMAGE_32, + TB_LISTEN_IMAGE_33, + TB_LISTEN_IMAGE_34, + TB_LISTEN_IMAGE_35, + TB_LISTEN_IMAGE_36, + TB_LISTEN_IMAGE_37, + TB_LISTEN_IMAGE_38, + TB_LISTEN_IMAGE_39, + TB_LISTEN_IMAGE_40, + TB_LISTEN_IMAGE_41, + TB_LISTEN_IMAGE_42, + TB_LISTEN_IMAGE_43, + TB_LISTEN_IMAGE_44, + TB_LISTEN_IMAGE_45, + TB_LISTEN_IMAGE_46, + TB_LISTEN_IMAGE_47, + TB_LISTEN_IMAGE_48, + TB_LISTEN_IMAGE_49, + TB_LISTEN_IMAGE_50, + TB_LISTEN_IMAGE_51, + TB_LISTEN_IMAGE_52, + TB_LISTEN_IMAGE_53, + TB_LISTEN_IMAGE_54, + TB_LISTEN_IMAGE_55, + TB_LISTEN_IMAGE_56, + TB_LISTEN_IMAGE_57, + TB_LISTEN_IMAGE_58, + TB_LISTEN_IMAGE_59, + TB_LISTEN_IMAGE_60, + TB_LISTEN_IMAGE_61, + }; + + ThunderBirdDialogueView::ThunderBirdDialogueView() + { + g_pThunderBirdDialogueView = this; + } + + ThunderBirdDialogueView::~ThunderBirdDialogueView() + { + g_pThunderBirdDialogueView = nullptr; + ClearAll(); + } + + ThunderBirdDialogueView *ThunderBirdDialogueView::GetInstance(void) + { + return g_pThunderBirdDialogueView; + } + + void ThunderBirdDialogueView::ClearAll(void) + { + if (group != nullptr) + { + group->RemoveAll(); + delete group; + group = nullptr; + } + if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } + if (speakAnimator != nullptr) { delete speakAnimator; speakAnimator = nullptr; } + if (listenAnimator != nullptr) { delete listenAnimator; listenAnimator = nullptr; } + } + bool ThunderBirdDialogueView::EnsureSpeakAnimator() + { + if (speakAnimator == nullptr) + { + speakPathsArray = TB_SPEAK_PATHS; + speakAnimator = new UIImageAnimatorView(); + if (speakAnimator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView new UIImageAnimatorView fail"); + return false; + } + speakAnimator->SetAutoEnable(false); + for (uint8_t i = 0; i < TB_SPEAK_ANIM_FRAMES; i++) + { + speakImageInfo[i].imagePath = (speakPathsArray[i]); + speakImageInfo[i].imageType = IMG_SRC_FILE_PATH; + speakImageInfo[i].pos.x = TB_SPEAK_ANIM_X; + speakImageInfo[i].pos.y = TB_SPEAK_ANIM_Y; + speakImageInfo[i].width = TB_SPEAK_ANIM_W; + speakImageInfo[i].height = TB_SPEAK_ANIM_H; + } + speakAnimator->SetPosition(TB_SPEAK_ANIM_X, TB_SPEAK_ANIM_Y, TB_SPEAK_ANIM_W, TB_SPEAK_ANIM_H); + speakAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + speakAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + speakAnimator->SetImageAnimatorSrc(speakImageInfo, TB_SPEAK_ANIM_FRAMES, TB_SPEAK_ANIM_INTERVAL); + speakAnimator->SetRepeat(true); + speakAnimator->SetResizeMode(UIImageView::COVER); + //speakAnimator->SetAnimatorStopListener(this); + } + return true; + } + bool ThunderBirdDialogueView::EnsureListenAnimator() + { + if (listenAnimator == nullptr) + { + listenPathsArray = TB_LISTEN_PATHS; + listenAnimator = new UIImageAnimatorView(); + if (listenAnimator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView new UIImageAnimatorView fail"); + return false; + } + listenAnimator->SetAutoEnable(false); + for (uint8_t i = 0; i < TB_LISTEN_ANIM_FRAMES; i++) + { + listenImageInfo[i].imagePath = (listenPathsArray[i]); + listenImageInfo[i].imageType = IMG_SRC_FILE_PATH; + listenImageInfo[i].pos.x = TB_LISTEN_ANIM_X; + listenImageInfo[i].pos.y = TB_LISTEN_ANIM_Y; + listenImageInfo[i].width = TB_LISTEN_ANIM_W; + listenImageInfo[i].height = TB_LISTEN_ANIM_H; + } + listenAnimator->SetPosition(TB_LISTEN_ANIM_X, TB_LISTEN_ANIM_Y, TB_LISTEN_ANIM_W, TB_LISTEN_ANIM_H); + listenAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + listenAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + listenAnimator->SetImageAnimatorSrc(listenImageInfo, TB_LISTEN_ANIM_FRAMES, TB_LISTEN_ANIM_INTERVAL); + listenAnimator->SetRepeat(true); + listenAnimator->SetResizeMode(UIImageView::COVER); + //listenAnimator->SetAnimatorStopListener(this); + } + return true; + } + + UIViewGroup *ThunderBirdDialogueView::ThunderBirdDialogueViewInit(void) + { + group = new UIViewGroup(); + if (group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView::group null!"); + return nullptr; + } + group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + + // 公共控件 + TextLabel = new UILabelExt(); + if (TextLabel) + { + TextLabel->SetPosition(0, 64, 360, 42); + TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + TextLabel->SetRollSpeed(35); + TextLabel->SetVisible(false); + group->Add(TextLabel); + } + if(!EnsureSpeakAnimator()) + { + return nullptr; + } + if(!EnsureListenAnimator()) + { + return nullptr; + } + group->Add(speakAnimator); + group->Add(listenAnimator); + + return group; + } + + void ThunderBirdDialogueView::Show(int16_t showView) + { + if (group == nullptr) { return; } + if (TextLabel) { TextLabel->SetVisible(false);} + if (speakAnimator) { speakAnimator->SetVisible(false); speakAnimator->Stop(); } + if (listenAnimator) { listenAnimator->SetVisible(false); listenAnimator->Stop(); } + + switch (showView) + { + case THUNDERBIRD_DIALOGUEVIEW_SPEAKING: + { + if (TextLabel) + { + TextLabel->SetText("保镖小姐 , 你来啦"); + TextLabel->SetVisible(true); + } + //动效图标 + if (speakAnimator) { speakAnimator->SetVisible(true); speakAnimator->Start(); } + break; + } + case THUNDERBIRD_DIALOGUEVIEW_LISTENING: + { + if (TextLabel) + { + TextLabel->SetPosition(111, 64, 180, 42); + TextLabel->SetText("超认真聆听中"); + TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); + TextLabel->SetVisible(true); + } + //动效图标 + if (listenAnimator) { listenAnimator->SetVisible(true); listenAnimator->Start(); } + break; + } + case THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW: + { + if (TextLabel) + { + TextLabel->SetText("发呆中..."); + TextLabel->SetVisible(true); + } + break; + } + default: + break; + } + } +} + + diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp similarity index 63% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp index 06108f5a6..db75d3abb 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp @@ -1,4 +1,5 @@ #include "thunderbird/include/ThunderBirdGuideView.h" +#include "thunderbird/include/ThunderBirdMainView.h" #include "wearable_log.h" namespace OHOS @@ -29,9 +30,8 @@ namespace OHOS delete group; group = nullptr; } - if (titleLabel != nullptr) { delete titleLabel; titleLabel = nullptr; } + if (RemindButton != nullptr) { delete RemindButton; RemindButton = nullptr; } if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } - if (RemindGround != nullptr) { delete RemindGround; RemindGround = nullptr; } if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } } @@ -55,13 +55,22 @@ namespace OHOS TextLabel->SetVisible(false); group->Add(TextLabel); } + RemindButton = new UILabelButton(); + if (RemindButton) + { + RemindButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff635d58, UIButton::RELEASED); + RemindButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff7c7773, UIButton::RELEASED); + RemindButton->SetStyleForState(STYLE_BORDER_WIDTH, 2, UIButton::RELEASED); + RemindButton->SetVisible(false); + group->Add(RemindButton); + } RemindGround = new UIImageView(); if (RemindGround) { - RemindGround->SetPosition(140, 175, 180, 48); - RemindGround->SetStyle(STYLE_BACKGROUND_COLOR, 0xff95847b); + RemindGround->SetAutoEnable(false); + RemindGround->SetPosition(128, 164, 94, 94); RemindGround->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - RemindGround->SetStyle(STYLE_BORDER_RADIUS, 80); + RemindGround->SetResizeMode(UIImageView::CONTAIN); RemindGround->SetVisible(false); group->Add(RemindGround); } @@ -88,8 +97,8 @@ namespace OHOS void ThunderBirdGuideView::Show(int16_t showView) { if (group == nullptr) { return; } - if (TextLabel) { TextLabel->SetVisible(false); } - if (RemindGround) { RemindGround->SetVisible(false); } + if (TextLabel) { TextLabel->SetVisible(false);TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);} + if (RemindButton) { RemindButton->SetVisible(false); } if (RemindLabel) { RemindLabel->SetVisible(false); } if (RemindIcon) { RemindIcon->SetVisible(false); } @@ -99,23 +108,22 @@ namespace OHOS { if (TextLabel) { - TextLabel->SetPosition(0, 104, 466, 48); - TextLabel->SetText("Hey, 我是毛毛~"); + TextLabel->SetPosition(0, 64, 360, 42); + TextLabel->SetText("Hey, 我是Amby~"); TextLabel->SetVisible(true); } - if(RemindGround) - { - RemindGround->SetVisible(true); - } - if (RemindLabel) + if (RemindButton) { - RemindLabel->SetText("按 下一页"); - RemindLabel->SetVisible(true); + RemindButton->SetPosition(106, 114, 148, 40); + RemindButton->SetText("按 下一页"); + RemindButton->SetLabelPosition(16, 6); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); } if(RemindIcon) { - RemindIcon->SetPosition(180, 175, 30, 30); - RemindIcon->SetSrc("/user/res/volumeup.bin"); + RemindIcon->SetPosition(148, 122, 24, 24); + RemindIcon->SetSrc("/user/res/volume_up.bin"); RemindIcon->SetVisible(true); } @@ -125,47 +133,46 @@ namespace OHOS { if (TextLabel) { - TextLabel->SetPosition(0, 104, 466, 48); + TextLabel->SetPosition(0, 64, 466, 42); TextLabel->SetText("我可以和你聊天,哄你睡觉"); + TextLabel->SetRollSpeed(35); TextLabel->SetVisible(true); } - if(RemindGround) + if (RemindButton) { - RemindGround->SetVisible(true); - } - if (RemindLabel) - { - RemindLabel->SetText("按 下一页"); - RemindLabel->SetVisible(true); + RemindButton->SetPosition(106, 114, 148, 40); + RemindButton->SetText("按 下一页"); + RemindButton->SetLabelPosition(16, 6); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); } if(RemindIcon) { - RemindIcon->SetPosition(180, 175, 30, 30); - RemindIcon->SetSrc("/user/res/volumeup.bin"); + RemindIcon->SetPosition(148, 122, 24, 24); + RemindIcon->SetSrc("/user/res/volume_up.bin"); RemindIcon->SetVisible(true); } break; } case THUNDERBIRD_GUIDEVIEW_3: { + ThunderBirdMainView::GetInstance()->OpenBackGround(); if (TextLabel) { - TextLabel->SetPosition(0, 104, 466, 48); + TextLabel->SetPosition(60, 64, 240, 84); TextLabel->SetText("换角色、挑声音、哄睡...扫码尽享受"); + TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);//自动换行 TextLabel->SetVisible(true); } - if(RemindGround) - { - RemindGround->SetVisible(true); - } + if (RemindLabel) { - RemindLabel->SetText("按 跳过"); + RemindLabel->SetText("按 跳过"); RemindLabel->SetVisible(true); } if(RemindIcon) { - RemindIcon->SetPosition(180, 175, 30, 30); + RemindIcon->SetPosition(192, 185, 30, 30); RemindIcon->SetSrc("/user/res/volumeup.bin"); RemindIcon->SetVisible(true); } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp new file mode 100644 index 000000000..061268e1d --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp @@ -0,0 +1,385 @@ +#include "thunderbird/include/ThunderBirdLullabyView.h" +#include "thunderbird/include/ThunderBirdMainView.h" +#include "wearable_log.h" +#include +#include +#include "UiConfig.h" + +namespace OHOS +{ + static ThunderBirdLullabyView *g_pThunderBirdLullabyView{nullptr}; + static const char *TB_LULLABY_LISTEN_PATHS[TB_LISTEN_FRAMES] = { + TB_LISTEN_IMAGE_1, + TB_LISTEN_IMAGE_2, + TB_LISTEN_IMAGE_3, + TB_LISTEN_IMAGE_4, + TB_LISTEN_IMAGE_5, + TB_LISTEN_IMAGE_6, + TB_LISTEN_IMAGE_7, + TB_LISTEN_IMAGE_8, + TB_LISTEN_IMAGE_9, + TB_LISTEN_IMAGE_10, + TB_LISTEN_IMAGE_11, + TB_LISTEN_IMAGE_12, + TB_LISTEN_IMAGE_13, + TB_LISTEN_IMAGE_14, + TB_LISTEN_IMAGE_15, + TB_LISTEN_IMAGE_16, + TB_LISTEN_IMAGE_17, + TB_LISTEN_IMAGE_18, + TB_LISTEN_IMAGE_19, + TB_LISTEN_IMAGE_20, + TB_LISTEN_IMAGE_21, + TB_LISTEN_IMAGE_22, + TB_LISTEN_IMAGE_23, + TB_LISTEN_IMAGE_24, + TB_LISTEN_IMAGE_25, + TB_LISTEN_IMAGE_26, + TB_LISTEN_IMAGE_27, + TB_LISTEN_IMAGE_28, + TB_LISTEN_IMAGE_29, + TB_LISTEN_IMAGE_30, + TB_LISTEN_IMAGE_31, + TB_LISTEN_IMAGE_32, + TB_LISTEN_IMAGE_33, + TB_LISTEN_IMAGE_34, + TB_LISTEN_IMAGE_35, + TB_LISTEN_IMAGE_36, + TB_LISTEN_IMAGE_37, + TB_LISTEN_IMAGE_38, + TB_LISTEN_IMAGE_39, + TB_LISTEN_IMAGE_40, + TB_LISTEN_IMAGE_41, + TB_LISTEN_IMAGE_42, + TB_LISTEN_IMAGE_43, + TB_LISTEN_IMAGE_44, + TB_LISTEN_IMAGE_45, + TB_LISTEN_IMAGE_46, + TB_LISTEN_IMAGE_47, + TB_LISTEN_IMAGE_48, + TB_LISTEN_IMAGE_49, + TB_LISTEN_IMAGE_50, + TB_LISTEN_IMAGE_51, + TB_LISTEN_IMAGE_52, + TB_LISTEN_IMAGE_53, + TB_LISTEN_IMAGE_54, + TB_LISTEN_IMAGE_55, + TB_LISTEN_IMAGE_56, + TB_LISTEN_IMAGE_57, + TB_LISTEN_IMAGE_58, + TB_LISTEN_IMAGE_59, + TB_LISTEN_IMAGE_60, + TB_LISTEN_IMAGE_61, + TB_LISTEN_IMAGE_62, + TB_LISTEN_IMAGE_63, + TB_LISTEN_IMAGE_64, + TB_LISTEN_IMAGE_65, + TB_LISTEN_IMAGE_66, + TB_LISTEN_IMAGE_67, + TB_LISTEN_IMAGE_68, + TB_LISTEN_IMAGE_69, + TB_LISTEN_IMAGE_70, + TB_LISTEN_IMAGE_71, + TB_LISTEN_IMAGE_72, + TB_LISTEN_IMAGE_73, + TB_LISTEN_IMAGE_74, + TB_LISTEN_IMAGE_75, + TB_LISTEN_IMAGE_76, + TB_LISTEN_IMAGE_77, + TB_LISTEN_IMAGE_78, + TB_LISTEN_IMAGE_79, + TB_LISTEN_IMAGE_80, + TB_LISTEN_IMAGE_81, + TB_LISTEN_IMAGE_82, + TB_LISTEN_IMAGE_83, + TB_LISTEN_IMAGE_84, + TB_LISTEN_IMAGE_85, + TB_LISTEN_IMAGE_86, + TB_LISTEN_IMAGE_87, + TB_LISTEN_IMAGE_88, + TB_LISTEN_IMAGE_89, + TB_LISTEN_IMAGE_90, + TB_LISTEN_IMAGE_91, + TB_LISTEN_IMAGE_92, + TB_LISTEN_IMAGE_93, + TB_LISTEN_IMAGE_94, + TB_LISTEN_IMAGE_95, + }; + + ThunderBirdLullabyView::ThunderBirdLullabyView() + { + g_pThunderBirdLullabyView = this; + } + + ThunderBirdLullabyView::~ThunderBirdLullabyView() + { + g_pThunderBirdLullabyView = nullptr; + ClearAll(); + } + + ThunderBirdLullabyView *ThunderBirdLullabyView::GetInstance(void) + { + return g_pThunderBirdLullabyView; + } + + void ThunderBirdLullabyView::ClearAll(void) + { + if (group != nullptr) + { + group->RemoveAll(); + delete group; + group = nullptr; + } + if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } + if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } + if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } + if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } + if (listenAnimator != nullptr) { delete listenAnimator; listenAnimator = nullptr; } + } + bool ThunderBirdLullabyView::EnsureListenAnimator() + { + if (listenAnimator == nullptr) + { + listenPathsArray = TB_LULLABY_LISTEN_PATHS; + listenAnimator = new UIImageAnimatorView(); + if (listenAnimator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdLullabyView new UIImageAnimatorView fail"); + return false; + } + listenAnimator->SetAutoEnable(false); + for (uint8_t i = 0; i < TB_LISTEN_FRAMES; i++) + { + listenImageInfo[i].imagePath = (listenPathsArray[i]); + listenImageInfo[i].imageType = IMG_SRC_FILE_PATH; + listenImageInfo[i].pos.x = TB_LISTEN_X; + listenImageInfo[i].pos.y = TB_LISTEN_Y; + listenImageInfo[i].width = TB_LISTEN_W; + listenImageInfo[i].height = TB_LISTEN_H; + } + listenAnimator->SetPosition(TB_LISTEN_X, TB_LISTEN_Y, TB_LISTEN_W, TB_LISTEN_H); + listenAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + listenAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + listenAnimator->SetImageAnimatorSrc(listenImageInfo, TB_LISTEN_FRAMES, TB_LISTEN_INTERVAL); + listenAnimator->SetRepeat(false); + listenAnimator->SetRepeatTimes(1); + listenAnimator->SetResizeMode(UIImageView::COVER); + //listenAnimator->SetAnimatorStopListener(this); + } + return true; + } + + UIViewGroup *ThunderBirdLullabyView::ThunderBirdLullabyViewInit(void) + { + group = new UIViewGroup(); + if (group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdLullabyView::group null!"); + return nullptr; + } + group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + + // 公共控件 + TextLabel = new UILabelExt(); + if (TextLabel) + { + TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + TextLabel->SetVisible(false); + group->Add(TextLabel); + } + RemindLabel = new UILabelExt(); + if (RemindLabel) + { + RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindLabel->SetVisible(false); + group->Add(RemindLabel); + } + RemindIcon = new UIImageView(); + if (RemindIcon) + { + RemindIcon->SetAutoEnable(false); + RemindIcon->SetVisible(false); + group->Add(RemindIcon); + } + RemindIcon2 = new UIImageView(); + if (RemindIcon2) + { + RemindIcon2->SetAutoEnable(false); + RemindIcon2->SetVisible(false); + group->Add(RemindIcon2); + } + if(!EnsureListenAnimator()) + { + return nullptr; + } + group->Add(listenAnimator); + + return group; + } + + void ThunderBirdLullabyView::Show(int16_t showView) + { + if (group == nullptr) { return; } + if (TextLabel) { TextLabel->SetVisible(false); + TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + TextLabel->SetRollSpeed(35); } + if (RemindLabel) { RemindLabel->SetVisible(false);} + if (RemindIcon) { RemindIcon->SetVisible(false); } + if (RemindIcon2) { RemindIcon2->SetVisible(false); } + if (listenAnimator) { listenAnimator->SetVisible(false); listenAnimator->Stop(); } + + switch (showView) + { + case THUNDERBIRD_LULLABYVIEW_1: + { + if (TextLabel) + { + TextLabel->SetPosition(43, 64, 268, 42); + TextLabel->SetText("按 说「哄我睡觉」"); + TextLabel->SetVisible(true); + } + if(RemindIcon) + { + RemindIcon->SetPosition(79, 69, 36, 36); + RemindIcon->SetSrc("/user/res/voice.bin"); + RemindIcon->SetVisible(true); + } + break; + } + case THUNDERBIRD_LULLABYVIEW_2: + { + ThunderBirdMainView::GetInstance()->OpenBackGround(); + if (TextLabel) + { + TextLabel->SetPosition(60, 140, 240, 42); + TextLabel->SetText("是否开启哄睡模式"); + TextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 确认"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_LULLABYVIEW_3: + { + ThunderBirdMainView::GetInstance()->OpenBackGround(); + if (TextLabel) + { + TextLabel->SetPosition(82, 148, 240, 42); + TextLabel->SetText("告诉我想听的故事"); + TextLabel->SetVisible(true); + } + if (listenAnimator) { listenAnimator->SetVisible(true); listenAnimator->Start(); } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 随机"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_LULLABYVIEW_4: + { + ThunderBirdModel::GetInstance()->StartCountUpTimer(15 * 60); + if (TextLabel) + { + TextLabel->SetPosition(0, 64, 360, 42); + TextLabel->SetText("从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?"); + TextLabel->SetVisible(true); + } + if(RemindLabel) + { + + RemindLabel->SetPosition(155, 114, 131, 28); + RemindLabel->SetText("04:00/15:00"); + RemindLabel->SetVisible(true); + } + break; + } + case THUNDERBIRD_LULLABYVIEW_5: + { + ThunderBirdMainView::GetInstance()->OpenBackGround(); + if (TextLabel) + { + TextLabel->SetPosition(60, 148, 240, 42); + TextLabel->SetText("是否退出哄睡模式"); + TextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 确认"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + default: + break; + } + } + void ThunderBirdLullabyView::UpdateTimeText(uint32_t currentSeconds, uint32_t totalSeconds) + { + if (RemindLabel == nullptr) { return; } + // 保护:避免除零或异常 + uint32_t safeTotal = (totalSeconds == 0) ? 1 : totalSeconds; + // 取值范围保护:当前不能超过总时长 + if (currentSeconds > safeTotal) { currentSeconds = safeTotal; } + + // 格式化为 mm:ss/mm:ss + auto formatToMMSS = [](uint32_t seconds) -> std::string { + uint32_t minutes = seconds / 60; + uint32_t secs = seconds % 60; + char buf[8]; // mm:ss + \0 + std::snprintf(buf, sizeof(buf), "%02u:%02u", minutes, secs); + return std::string(buf); + }; + + std::string left = formatToMMSS(currentSeconds); + std::string right = formatToMMSS(safeTotal); + std::string merged = left + "/" + right; + RemindLabel->SetText(merged.c_str()); + } +} + + diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp similarity index 63% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp index 6a811a472..1fa74c0b5 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp @@ -9,24 +9,26 @@ #include "ui_resource_image.h" #include #include "components/ui_button.h" -#include "MainViewSample.h" +//#include "MainViewSample.h" #include "components/ui_view_group.h" #include "UiConfig.h" -#include "uicomponents/UIComponents.h" -#include "MainPresenterSample.h" +//#include "uicomponents/UIComponents.h" +//#include "MainPresenterSample.h" #include "thunderbird/include/ThunderBirdMainView.h" #include "thunderbird/include/ThunderBirdShutdownView.h" +#include "thunderbird/include/ThunderBirdShutdownTestView.h" #include "wearable_log.h" -#include "screennotify/include/ui_screennotify.h" +#include "screennotify/ui_screennotify.h" #include "custom_utils.h" #include #include #include "battery_hal.h" #include "battery_service.h" #include "custom_runtime.h" +#include namespace OHOS { static constexpr int16_t VIDEO_WIDTH = 466; @@ -86,7 +88,7 @@ namespace OHOS ScrollView_ = nullptr; } g_pThunderBirdMainView = nullptr; - ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); // 关闭屏幕常亮 + ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); // 关闭屏幕常亮 ThunderBirdModel::GetInstance()->StopTimer(); } @@ -98,14 +100,51 @@ namespace OHOS void ThunderBirdMainView::DeInit() { // 释放各子界面对象 - if (g_pThunderBirdView) { delete g_pThunderBirdView; g_pThunderBirdView = nullptr; } - if (g_pThunderBirdOtaView) { delete g_pThunderBirdOtaView; g_pThunderBirdOtaView = nullptr; } - if (g_pThunderBirdGuideView) { delete g_pThunderBirdGuideView; g_pThunderBirdGuideView = nullptr; } - if (g_pThunderBirdLullabyView) { delete g_pThunderBirdLullabyView; g_pThunderBirdLullabyView = nullptr; } - if (g_pThunderBirdDialogueView) { delete g_pThunderBirdDialogueView; g_pThunderBirdDialogueView = nullptr; } - if (g_pThunderBirdReminderView) { delete g_pThunderBirdReminderView; g_pThunderBirdReminderView = nullptr; } - if (g_pThunderBirdAdjustView) { delete g_pThunderBirdAdjustView; g_pThunderBirdAdjustView = nullptr; } - if (g_pThunderBirdShutdownView) { delete g_pThunderBirdShutdownView; g_pThunderBirdShutdownView = nullptr; } + if (g_pThunderBirdOtaView) + { + delete g_pThunderBirdOtaView; + g_pThunderBirdOtaView = nullptr; + } + if (g_pThunderBirdGuideView) + { + delete g_pThunderBirdGuideView; + g_pThunderBirdGuideView = nullptr; + } + if (g_pThunderBirdLullabyView) + { + delete g_pThunderBirdLullabyView; + g_pThunderBirdLullabyView = nullptr; + } + if (g_pThunderBirdDialogueView) + { + delete g_pThunderBirdDialogueView; + g_pThunderBirdDialogueView = nullptr; + } + if (g_pThunderBirdReminderView) + { + delete g_pThunderBirdReminderView; + g_pThunderBirdReminderView = nullptr; + } + if (g_pThunderBirdAdjustView) + { + delete g_pThunderBirdAdjustView; + g_pThunderBirdAdjustView = nullptr; + } + if (g_pThunderBirdShutdownView) + { + delete g_pThunderBirdShutdownView; + g_pThunderBirdShutdownView = nullptr; + } + if (g_pThunderBirdShutdownTestView) + { + delete g_pThunderBirdShutdownTestView; + g_pThunderBirdShutdownTestView = nullptr; + } + if (g_pThunderBirdShutdownView) + { + delete g_pThunderBirdShutdownView; + g_pThunderBirdShutdownView = nullptr; + } // 置空所有分组索引,避免悬空指针 for (int i = 0; i < MAXVIEW; i++) { @@ -132,7 +171,7 @@ namespace OHOS g_lastPlayed = false; // 注销屏幕状态通知 - deregisterNotifyScreenStatus(ScreenStatusNotify); + //deregisterNotifyScreenStatus(ScreenStatusNotify); if (curFace != nullptr) { @@ -219,32 +258,74 @@ namespace OHOS ScrollView_->SetTouchable(true); ScrollView_->SetDraggable(true); AddViewToRootContainer(ScrollView_); - RootView::GetInstance()->SetOnKeyActListener(presenter_); - - Initback(); - // 顶部状态栏 - InitBaseData(); + Initback(); // 最底层 + + // ScrollView_->Add(group[THUNDERBIRD_GUIDEVIEW]); + // //顶部状态栏 + // if (pagesGroup == nullptr) + // { + // pagesGroup = new UIViewGroup(); + // if (pagesGroup == nullptr) + // { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "pagesGroup new fail"); + // return; + // } + // } + // g_pThunderBirdShutdownTestView = new ThunderBirdShutdownTestView(); + // pagesGroup = g_pThunderBirdShutdownTestView->Init(); + // ScrollView_->Add(pagesGroup); + // g_pThunderBirdShutdownTestView->StartAnimation(); + iconView = new UIImageView(); //(表情图片)需要遮罩时启用,预先增加在对应图层 + iconView->SetAutoEnable(false); + iconView->SetPosition(0, 0, 466, 466); + iconView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + iconView->SetResizeMode(UIImageView::COVER); + iconView->SetSrc("/user/res/emoticon/naughty/1.bin"); + iconView->SetVisible(false); + ScrollView_->Add(iconView); + + backGroundView = new UIImageView(); //(黑色遮罩)需要遮罩时启用,预先增加在对应图层 + backGroundView->SetAutoEnable(false); + backGroundView->SetPosition(0, 0, 466, 466); + backGroundView->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + backGroundView->SetStyle(STYLE_BACKGROUND_OPA, 0xD0); + backGroundView->SetVisible(false); + ScrollView_->Add(backGroundView); + // 默认显示主界面 - ChangeView(MAXVIEW, THUNDERBIRD_GUIDEVIEW,0); + ChangeView(MAXVIEW, THUNDERBIRD_GUIDEVIEW, 0); // 文字显示图层 + // iconLabel = new UILabel(); + // iconLabel->SetPosition(0, 160, 466, 40); + // iconLabel->SetStyle(STYLE_TEXT_COLOR, 0xffffffff); + // iconLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + // iconLabel->SetText("你好,我是Amby~"); + // iconLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34); + // iconLabel->SetVisible(true); + // ScrollView_->Add(iconLabel); + + ScrollView_->Add(InitBaseData()); // 最上面状态栏 // 增加按键监听 RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::ThunderBirdPresenter::GetInstance(); RootView::GetInstance()->SetOnKeyActListener(keyactListener); } } - bool ThunderBirdMainView::SwitchVideo(const char *uri) + bool ThunderBirdMainView::SwitchVideo(const char *uri) // 切换表情接口 { - if (uri == nullptr || surfaceView_ == nullptr) { + if (uri == nullptr || surfaceView_ == nullptr) + { return false; } // 停止并销毁旧播放器 if (videoPlay_ != nullptr) { - if (videoPlay_->isPlayed_) { + if (videoPlay_->isPlayed_) + { videoPlay_->PauseVideoPlay(); } - if (videoPlay_->isEntered_) { + if (videoPlay_->isEntered_) + { videoPlay_->StopVideoPlay(); } delete videoPlay_; @@ -252,13 +333,15 @@ namespace OHOS } Surface *surface = surfaceView_->GetSurface(); - if (surface == nullptr) { - return false; - } + if (surface == nullptr) + { + return false; + } // 创建新播放器并启动 videoPlay_ = new MediaVideoPlay(surface, nullptr, std::string(uri), false); - if (videoPlay_ == nullptr) { + if (videoPlay_ == nullptr) + { return false; } g_videoPlay = videoPlay_; @@ -266,7 +349,7 @@ namespace OHOS return (ret == 0); } - void ThunderBirdMainView::CloseVideo() + void ThunderBirdMainView::CloseVideo() // 关闭表情接口 { // 停止视频并释放播放器 if (videoPlay_ != nullptr) @@ -285,7 +368,7 @@ namespace OHOS g_videoPlay = nullptr; g_lastPlayed = false; // 注销屏幕状态通知 - deregisterNotifyScreenStatus(ScreenStatusNotify); + //deregisterNotifyScreenStatus(ScreenStatusNotify); // 释放表面与背景 if (surfaceView_ != nullptr) { @@ -298,26 +381,8 @@ namespace OHOS curFace = nullptr; } } - bool ThunderBirdMainView::ChangeThunderBirdView(int16_t thisView) - { - // 检查视图是否已初始化 - if (group[thisView] == nullptr) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodPressureView::ChangeUnderInitialCalibrationView"); - g_pThunderBirdView = new ThunderBirdView(); - if (g_pThunderBirdView == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodPressureView:: new scrollView[%d] fail", thisView); - return false; - } - // 初始化视图并添加到视图组 - group[thisView] = g_pThunderBirdView->ThunderBirdViewInit(); - ScrollView_->Add(group[thisView]); - } - return true; - } - bool ThunderBirdMainView::ChangeThunderBirdOtaView(int16_t thisView) + bool ThunderBirdMainView::ChangeThunderBirdOtaView(int16_t thisView) // 切换Ota界面接口 { if (group[thisView] == nullptr) { @@ -333,7 +398,7 @@ namespace OHOS return true; } - bool ThunderBirdMainView::ChangeThunderBirdGuideView(int16_t thisView) + bool ThunderBirdMainView::ChangeThunderBirdGuideView(int16_t thisView) // 切换引导界面接口 { if (group[thisView] == nullptr) { @@ -349,7 +414,7 @@ namespace OHOS return true; } - bool ThunderBirdMainView::ChangeThunderBirdLullabyView(int16_t thisView) + bool ThunderBirdMainView::ChangeThunderBirdLullabyView(int16_t thisView) // 切换哄睡界面接口 { if (group[thisView] == nullptr) { @@ -365,7 +430,7 @@ namespace OHOS return true; } - bool ThunderBirdMainView::ChangeThunderBirdDialogueView(int16_t thisView) + bool ThunderBirdMainView::ChangeThunderBirdDialogueView(int16_t thisView) // 切换对话界面接口 { if (group[thisView] == nullptr) { @@ -381,7 +446,7 @@ namespace OHOS return true; } - bool ThunderBirdMainView::ChangeThunderBirdReminderView(int16_t thisView) + bool ThunderBirdMainView::ChangeThunderBirdReminderView(int16_t thisView) // 切换提醒界面接口 { if (group[thisView] == nullptr) { @@ -397,7 +462,7 @@ namespace OHOS return true; } - bool ThunderBirdMainView::ChangeThunderBirdAdjustView(int16_t thisView) + bool ThunderBirdMainView::ChangeThunderBirdAdjustView(int16_t thisView) // 切换调整界面接口 { if (group[thisView] == nullptr) { @@ -412,7 +477,7 @@ namespace OHOS } return true; } - bool ThunderBirdMainView::ChangeThunderBirdShutdownView(int16_t thisView) + bool ThunderBirdMainView::ChangeThunderBirdShutdownView(int16_t thisView) // 切换关机界面接口 { if (group[thisView] == nullptr) { @@ -429,7 +494,22 @@ namespace OHOS } return true; } - + bool ThunderBirdMainView::ChangeThunderBirdShutdownTestView(int16_t thisView) // 切换关机测试界面接口 + { + if (group[thisView] == nullptr) + { + g_pThunderBirdShutdownTestView = new ThunderBirdShutdownTestView(); + if (g_pThunderBirdShutdownTestView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownTestView new fail %d", thisView); + return false; + } + group[thisView] = g_pThunderBirdShutdownTestView->Init(); + ScrollView_->Add(group[thisView]); + g_pThunderBirdShutdownTestView->StartAnimation(); + } + return true; + } /** * 视图映射结构体 - 将视图ID映射到对应的视图切换函数 @@ -441,7 +521,6 @@ namespace OHOS }; static const TBViewMapper ViewMapper[] = { - {THUNDERBIRDMENUVIEW, &ThunderBirdMainView::ChangeThunderBirdView}, {THUNDERBIRD_OTAVIEW, &ThunderBirdMainView::ChangeThunderBirdOtaView}, {THUNDERBIRD_GUIDEVIEW, &ThunderBirdMainView::ChangeThunderBirdGuideView}, {THUNDERBIRD_LULLABYVIEW, &ThunderBirdMainView::ChangeThunderBirdLullabyView}, @@ -449,6 +528,7 @@ namespace OHOS {THUNDERBIRD_REMINDERVIEW, &ThunderBirdMainView::ChangeThunderBirdReminderView}, {THUNDERBIRD_ADJUSTVIEW, &ThunderBirdMainView::ChangeThunderBirdAdjustView}, {THUNDERBIRD_SHUTDOWNVIEW, &ThunderBirdMainView::ChangeThunderBirdShutdownView}, + {THUNDERBIRD_SHUTDOWNTESTVIEW, &ThunderBirdMainView::ChangeThunderBirdShutdownTestView}, }; bool ThunderBirdMainView::ClickFunc(int16_t interface) @@ -486,9 +566,21 @@ namespace OHOS } group[hideView]->SetVisible(false); } + // 同用遮罩,部分界面在内部自行开启,其余界面关闭 + iconView->SetVisible(false); + backGroundView->SetVisible(false); + // 保存上一级视图信息 + prevView_ = currentView_; + prevSubView_ = currentSubView_; ClickFunc(showView); group[showView]->SetVisible(true); - group[showView]->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + group[showView]->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + // 关键:把状态栏重新加到末尾,确保最上层 + if (group1) + { + ScrollView_->Remove(group1); + ScrollView_->Add(group1); + } // 进入大界面后,根据 subView 跳转到其子界面 if (subView != -1) { @@ -534,10 +626,15 @@ namespace OHOS break; } } - currentView_ = showView;//更新当前视图 - currentSubView_ = subView;//更新当前子视图 + currentView_ = showView; // 更新当前视图 + currentSubView_ = subView; // 更新当前子视图 ScrollView_->Invalidate(); + } + void ThunderBirdMainView::OpenBackGround(void)//打开遮罩 + { + iconView->SetVisible(true); + backGroundView->SetVisible(true); } int16_t ThunderBirdMainView::GetCurrentView() const @@ -593,7 +690,7 @@ namespace OHOS return; } g_videoPlay = videoPlay_; - registerNotifyScreenStatus(ScreenStatusNotify); + //registerNotifyScreenStatus(ScreenStatusNotify); } if (videoPlay_->isExited_ || !videoPlay_->isEntered_) { @@ -603,7 +700,7 @@ namespace OHOS ScrollView_->Add(surfaceView_); ScrollView_->Add(curFace); } - void ThunderBirdMainView::InitBaseData() + UIViewGroup *ThunderBirdMainView::InitBaseData() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::InitBaseData"); if (group1 == nullptr) @@ -612,13 +709,23 @@ namespace OHOS if (group1 == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group1 new fail"); - return; + return nullptr; } } - group1->SetPosition(70, 40, 350, 40); + group1->SetPosition(96, 14, 168, 40); group1->SetStyle(STYLE_BACKGROUND_OPA, 0); - InitLabel(timeLabel, 0, (group1->GetHeight() - 38), 175, 38, "titleLable", "08:52", DEFAULT_VECTOR_FONT_FILENAME, 32); + timeLabel = new UILabelExt(); + if (timeLabel == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "timeLabel new fail"); + return nullptr; + } + timeLabel->SetPosition(0, 4, 46, 33); + timeLabel->SetViewId("timeLabel"); + timeLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 24); + timeLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + timeLabel->SetVisible(true); timeLabel->SetText(ThunderBirdModel::GetInstance()->GetCurrentTimeStr().c_str()); // 每秒变化 group1->Add(timeLabel); /* -------------------------------- NoSignal -------------------------------- */ @@ -628,7 +735,7 @@ namespace OHOS if (NoSignal == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NoSignal new fail"); - return; + return nullptr; } } NoSignal->SetPosition(140, (group1->GetHeight() - 38) / 2, 36, 38); @@ -648,7 +755,7 @@ namespace OHOS }; // 待添加的 ImageView 信息列表 std::vector imageViewList = { - {140, 28, 6, 6}, + {65+8, 28, 6, 6}, {150, 20, 6, 14}, {160, 12, 6, 22}, {170, 4, 6, 30}, @@ -663,7 +770,7 @@ namespace OHOS if (showSignalStrength[i] == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "showSignalStrength[%d] new fail", i); - return; + return nullptr; } } showSignalStrength[i]->SetPosition(imageViewList[i].posX, imageViewList[i].posY, imageViewList[i].width, imageViewList[i].height); @@ -678,7 +785,7 @@ namespace OHOS if (batteryimage == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryimage new fail"); - return; + return nullptr; } batteryimage->SetPosition(170 + 20, (group1->GetHeight() - 30) / 2, 48, 30); std::string batteryimagesPath = "/user/res/Battery_White.bin"; @@ -689,7 +796,7 @@ namespace OHOS if (progress == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "progress new fail"); - return; + return nullptr; } progress->SetPosition(batteryimage->GetX() + 7, batteryimage->GetY() + 6, 30, 18); progress->SetValidWidth(30); @@ -703,7 +810,15 @@ namespace OHOS progress->SetForegroundStyle(STYLE_LINE_COLOR, 0xff45A5FF); group1->Add(progress); /* -----------------------------------电量--------------------------------------- */ - InitUILabel(batteryLabel, batteryimage->GetX() + 58, (group1->GetHeight() - 28) / 2, 30, 28, "titleLable", "100", DEFAULT_VECTOR_FONT_FILENAME, 25); + batteryLabel = new UILabel(); + if (batteryLabel == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryLabel new fail"); + return nullptr; + } + batteryLabel->SetPosition(batteryimage->GetX() + 58, (group1->GetHeight() - 28) / 2, 30, 28); + batteryLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 25); + batteryLabel->SetText("100"); batteryLabel->SetStyle(STYLE_TEXT_COLOR, Color::White().full); batteryLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); group1->Add(batteryLabel); @@ -712,7 +827,7 @@ namespace OHOS if (!chargeBatteryicon) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "chargeBatteryicon creation failed"); - return; + return nullptr; } chargeBatteryicon->SetPosition(progress->GetX() + 6, batteryimage->GetY() + 2, 17, 26); chargeBatteryicon->SetSrc("/user/res/Icon.bin"); @@ -721,29 +836,30 @@ namespace OHOS chargeBatteryicon->SetVisible(false); group1->Add(chargeBatteryicon); /* -------------------------------------------------------------------------- */ - ScrollView_->Add(group1); + // ScrollView_->Add(group1); /* -------------------------------------------------------------------------- */ updateSignalDisplay(); /* -------------------------------------------------------------------------- */ UpdateBatteryProcess(); + return group1; } void ThunderBirdMainView::UpdateTimeText(const char *time) { timeLabel->SetText(time); // 每秒变化 } - void ThunderBirdMainView::updateSignalDisplay() + void ThunderBirdMainView::updateSignalDisplay() // 信号接收 { int sim = uapi_dev_runtime_get_cat1_simstat(); int cat1_powerOn = uapi_dev_runtime_get_cat1_powerstat(); int signal = uapi_dev_runtime_get_cat1_signal(); int network_on = uapi_dev_runtime_get_cat1_networkstat(); int cat1_network_type = uapi_dev_runtime_get_cat1_networtype(); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sim = %d", sim); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cat1_powerOn = %d", cat1_powerOn); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "signal = %d", signal); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "network_on = %d", network_on); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cat1_network_type = %d", cat1_network_type); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sim = %d", sim); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cat1_powerOn = %d", cat1_powerOn); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "signal = %d", signal); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "network_on = %d", network_on); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cat1_network_type = %d", cat1_network_type); const int SIGNAL_NO_SIGNAL = 99; @@ -754,6 +870,30 @@ namespace OHOS NoSignal->SetVisible(true); } UpdateSignalBarDisplay(CalculateSignalBars(signal), false); + // 处理网络标志位(无网络) + int8_t currentNet = 0; + if (lastNetworkOnline_ == -1) + { + lastNetworkOnline_ = currentNet; + } + if (lastNetworkOnline_ == 1 && currentNet == 0) + { + if (currentView_ == THUNDERBIRD_DIALOGUEVIEW || + (currentView_ == THUNDERBIRD_LULLABYVIEW && + (currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1 || + currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4))) // 只有在对话界面还有哄睡界面才触发 + { + // 从有网络到无网络:提示一次 + ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000); + ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW); + if (g_pThunderBirdReminderView) + { + g_pThunderBirdReminderView->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT); + } + + } + } + lastNetworkOnline_ = currentNet; } else if (cat1_powerOn == 1 && sim == 1) { @@ -765,6 +905,29 @@ namespace OHOS NoSignal->SetVisible(true); } UpdateSignalBarDisplay(CalculateSignalBars(signal), false); + // 从有网络到无网络:提示一次 + int8_t currentNet = 0; + if (lastNetworkOnline_ == -1) + { + lastNetworkOnline_ = currentNet; + } + if (lastNetworkOnline_ == 1 && currentNet == 0) + { + if (currentView_ == THUNDERBIRD_DIALOGUEVIEW || + (currentView_ == THUNDERBIRD_LULLABYVIEW && + (currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1 || + currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4))) // 只有在对话界面还有哄睡界面才触发 + { + ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000); + ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW); + if (g_pThunderBirdReminderView) + { + g_pThunderBirdReminderView->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT); + } + + } + } + lastNetworkOnline_ = currentNet; } else { @@ -773,6 +936,7 @@ namespace OHOS NoSignal->SetVisible(false); } UpdateSignalBarDisplay(CalculateSignalBars(signal), true); + lastNetworkOnline_ = 1; } } } @@ -813,16 +977,22 @@ namespace OHOS return 99; // Invalid signal strength } } - void ThunderBirdMainView::UpdateBatteryProcess() + void ThunderBirdMainView::UpdateBatteryProcess() // 电量接收及其提醒函数 { float voltage = 0.0F; - uint8_t value = 0; + Batteryvalue = 0; #ifdef SUPPORT_BATTERY_SERVICE - value = battery_get_voltage(&voltage); + Batteryvalue = battery_get_voltage(&voltage); #endif - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "battery_get_voltage = %d", value); - batteryLabel->SetText((std::to_string(static_cast(value))+"%").c_str()); // 电量 - progress->SetValue(value); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "battery_get_voltage = %d", Batteryvalue); + if (batteryLabel) + { + batteryLabel->SetText((std::to_string(static_cast(Batteryvalue))).c_str()); // 电量 + } + if (progress) + { + progress->SetValue(Batteryvalue); + } if (!chargeBatteryicon || !progress) { @@ -835,39 +1005,113 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "isCharging = %d", isCharging); #endif + // 充电流程:进入充电显示“充电中”(一次),满电显示“充电完成”(一次) if (isCharging) { if (!isChargeBatteryIconVisible) - { - chargeBatteryicon->SetVisible(true); // 充电图标 + { + chargeBatteryicon->SetVisible(true); // 充电图标 isChargeBatteryIconVisible = true; } - progress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::Green().full); // 充电状态为绿色 - return; - } - else - { - if (value <= 20) // 低电量 + progress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::Green().full); + + if (!wasCharging) { - if (isChargeBatteryIconVisible) + // int16_t currentView = GetCurrentView(); + // int16_t currentSubView = GetCurrentSubView(); + if (currentView_ == THUNDERBIRD_DIALOGUEVIEW || + (currentView_ == THUNDERBIRD_LULLABYVIEW && + (currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1 || + currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4))) // 只有在对话界面还有哄睡界面才触发 { - chargeBatteryicon->SetVisible(false); // 充电图标 - isChargeBatteryIconVisible = false; + // 首次进入充电状态,提醒一次,不走ChangeView + ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000); + ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW); // 不走ChangeView + if (g_pThunderBirdReminderView) + { + g_pThunderBirdReminderView->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGING); + } + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "currentView = %d, currentSubView = %d", currentView_, currentSubView_); + } - progress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); // 低电状态为红色 + wasCharging = true; + notifiedChargeFull = false; } - else // 非低电量 + + if (Batteryvalue >= 100 && !notifiedChargeFull) { - if (isChargeBatteryIconVisible) + if (currentView_ == THUNDERBIRD_DIALOGUEVIEW || + (currentView_ == THUNDERBIRD_LULLABYVIEW && + (currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1 || + currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4))) // 只有在对话界面还有哄睡界面才触发 { - chargeBatteryicon->SetVisible(false); // 充电图标 - isChargeBatteryIconVisible = false; + ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000); + ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW); // 不走ChangeView + if (g_pThunderBirdReminderView) + { + g_pThunderBirdReminderView->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE); + } + notifiedChargeFull = true; + } - - progress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::White().full); // 非充电状态为白色 } return; } + + // 非充电:重置充电相关一次性标记 + if (isChargeBatteryIconVisible) + { + chargeBatteryicon->SetVisible(false); + isChargeBatteryIconVisible = false; + } + wasCharging = false; + notifiedChargeFull = false; + + // 颜色显示 + if (Batteryvalue <= 20) + { + progress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); + } + else + { + progress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::White().full); + } + + // 电量阶段:3:>20, 2:(10,20], 1:(5,10], 0:<=5 + int16_t stage = 3; + if (Batteryvalue == 5) + stage = 0; + else if (Batteryvalue == 10) + stage = 1; + else if (Batteryvalue == 20) + stage = 2; + + // 阶段变更时提醒一次(从高到低跨阈值时触发) + if (stage != lastBatteryStage) + { + if (stage < lastBatteryStage || lastBatteryStage == -1) + { + if (stage <= 2) // 仅在<=20%三个档位弹低电量提醒 + { + if (currentView_ == THUNDERBIRD_DIALOGUEVIEW || + (currentView_ == THUNDERBIRD_LULLABYVIEW && + (currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1 || + currentSubView_ == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4))) // 只有在对话界面还有哄睡界面才触发 + { + ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000); + ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW); // 不走ChangeView + if (g_pThunderBirdReminderView) + { + g_pThunderBirdReminderView->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_LOW_BATTERY); + } + + } + } + } + lastBatteryStage = stage; + } + return; } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp new file mode 100644 index 000000000..b46dc95f2 --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -0,0 +1,350 @@ +/*** + * @Date: 2024-06-22 18:08:25 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-06-24 11:30:12 + * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThunderBirdModel.cpp + */ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-06-07 09:21:47 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-11-05 14:49:01 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/ThunderBirdModel.cpp + */ + +#include "thunderbird/include/ThunderBirdModel.h" +#include "thunderbird/include/ThunderBirdReminderView.h" +#include "thunderbird/include/ThunderBirdOtaView.h" +#include "thunderbird/include/ThunderBirdLullabyView.h" +#include "thunderbird/include/ThunderBirdMainView.h" +#include "wearable_log.h" +#include +#include +#include "wearable_log.h" +#include "custom_utils.h" +#include +namespace OHOS +{ + ThunderBirdModel::ThunderBirdModel() {} + ThunderBirdModel::~ThunderBirdModel() {} + + ThunderBirdModel *ThunderBirdModel::GetInstance() + { + static ThunderBirdModel instance; + return &instance; + } + // 获取当前时间戳字符串 + std::string ThunderBirdModel::GetCurrentTimeStr() + { + uint32_t timeStamp = 0; + if (uapi_get_timestampe_ss(&timeStamp) != ERRCODE_SUCC) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to get timestamp"); + return "----/--/-- \n --/--"; + } + // 将时间戳转换为 time_t 类型 + time_t rawtime = static_cast(timeStamp); + struct tm *timeinfo = localtime(&rawtime); + + if (timeinfo == NULL) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to convert time"); + return "----/--/-- \n --/--"; + } + + // 格式化时间为字符串 (HH:MM:SS format) + char buffer[20]; // 格式: HH:MM:SS + std::strftime(buffer, sizeof(buffer), "%H:%M", timeinfo); + return std::string(buffer); + } + void ThunderBirdModel::timer_callback_proc() + { + ThunderBirdMainView *view = ThunderBirdMainView::GetInstance(); + if (view) + { + view->UpdateTimeText(GetCurrentTimeStr().c_str()); + } + } + + /* ---------------------- 状态栏时间刷新定时器 ---------------------- */ + static osTimerId_t g_timer = nullptr; + /*定时器到期时的处理*/ + static void TimerCallbackProc(uint8_t data) + { + // 倒计时 + ThunderBirdModel::GetInstance()->timer_callback_proc(); + ThunderBirdMainView::GetInstance()->updateSignalDisplay(); + ThunderBirdMainView::GetInstance()->UpdateBatteryProcess(); + } + /* + * @brief 回调函数 + */ + static void TimerCallback(uint8_t data) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TimerCallback %d", data); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(TimerCallbackProc, data)); + } + + /* + * @brief 开启定时器函数 + * @param interval 时间间隔,单位ms + */ + void ThunderBirdModel::StartTimer(uint32_t interval) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::StartTimer"); + /* -------------------------- 1.检查定时器是否已经存在,如果存在则返回 + * ------------------------- */ + if (g_timer != nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Timer already exists!!"); + return; + } + + /* --------------------------------- 2.创建定时器 + * -------------------------------- */ + g_timer = osTimerNew((osTimerFunc_t)TimerCallback, osTimerPeriodic, + nullptr, nullptr); + // 检查定时器创建是否成功 + if (g_timer == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Timer create failed!!"); + return; + } + + /* ----------------------------- 3.将毫秒转换为系统时钟节拍数 + * ---------------------------- */ + /* --------------------------------- 4.启动定时器 + * -------------------------------- */ + osStatus_t ret = osTimerStart(g_timer, interval); + /* -------------------- 5.检查定时器启动是否成功,如果启动失败,删除定时器并置为 + * nullptr -------------------- */ + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, + "osTimerDelete failed, ret = %lx!!", ret); + if (g_timer != nullptr) + { + ret = osTimerDelete(g_timer); + } + g_timer = nullptr; + return; + } + } + /* + * @brief 停止定时器 + */ + void ThunderBirdModel::StopTimer(void) + { + // 检查定时器是否存在 + if (g_timer != nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::BP_StopTimer"); + osTimerStop(g_timer); + // 删除定时器并置为 nullptr + osStatus_t ret = osTimerDelete(g_timer); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, + "osTimerDelete failed, ret = %lx!!", ret); + } + g_timer = nullptr; + } + } + + /*----------------------提醒界面定时器----------------------------------*/ + static osTimerId_t g_reminderHideTimer = nullptr; + static void ReminderHideTimerCallbackProc(uint8_t data) + { + (void)data; + auto *reminder = ThunderBirdReminderView::GetInstance(); + if (reminder != nullptr) + { + reminder->HideAll(); + } + int16_t currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); + int16_t currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "currentView = %d, currentSubView = %d", currentView, currentSubView); + // 隐藏后切回之前的界面 + // auto *mainv = ThunderBirdReminderView::GetInstance(); + // if (mainv != nullptr)//判断条件需要修改 + // { + // mainv->Show(-1); + // } + } + static void ReminderHideTimerCallback(uint8_t data) + { + GraphicService::GetInstance()->PostGraphicEvent(std::bind(ReminderHideTimerCallbackProc, data)); + } + void ThunderBirdModel::StartReminderHideTimer(uint32_t intervalMs) + { + if (g_reminderHideTimer != nullptr) + { + osTimerStop(g_reminderHideTimer); + osStatus_t ret = osTimerDelete(g_reminderHideTimer); + (void)ret; + g_reminderHideTimer = nullptr; + } + g_reminderHideTimer = osTimerNew((osTimerFunc_t)ReminderHideTimerCallback, osTimerOnce, nullptr, nullptr); + if (g_reminderHideTimer == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartReminderHideTimer new timer failed!!"); + return; + } + osStatus_t ret = osTimerStart(g_reminderHideTimer, intervalMs); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartReminderHideTimer start failed, ret = %lx!!", ret); + osTimerDelete(g_reminderHideTimer); + g_reminderHideTimer = nullptr; + } + auto *reminder = ThunderBirdReminderView::GetInstance();//先隐藏全部提醒界面 + if (reminder != nullptr) + { + reminder->HideAll(); + } + } + + // ---------------------- OTA 倒计时定时器(5 -> 1,每步1秒) ---------------------- + static osTimerId_t g_otaCountdownTimer = nullptr; + static int g_otaCountdownValue = 0; + static void OtaCountdownTimerProc(uint8_t data) + { + (void)data; + if (g_otaCountdownValue < 1) + { + // 停止并删除 + if (g_otaCountdownTimer != nullptr) + { + osTimerStop(g_otaCountdownTimer); + osTimerDelete(g_otaCountdownTimer); + g_otaCountdownTimer = nullptr; + } + g_otaCountdownValue = 0; + //自动跳转到开始OTA界面 + ThunderBirdMainView::GetInstance()->ChangeView(THUNDERBIRD_OTAVIEW, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATING); + return; + + + } + g_otaCountdownValue -= 1; + GraphicService::GetInstance()->PostGraphicEvent([](){ + if (ThunderBirdOtaView::GetInstance()) + { + ThunderBirdOtaView::GetInstance()->UpdateCountdown(g_otaCountdownValue); + } + }); + } + static void OtaCountdownTimerCb(uint8_t data) + { + OtaCountdownTimerProc(data); + } + void ThunderBirdModel::StartOtaCountdown(uint32_t startVal) + { + // 范围保护 + if (startVal < 1) { startVal = 1; } + if (startVal > 5) { startVal = 5; } + // 先停旧定时器 + if (g_otaCountdownTimer != nullptr) + { + osTimerStop(g_otaCountdownTimer); + osTimerDelete(g_otaCountdownTimer); + g_otaCountdownTimer = nullptr; + } + g_otaCountdownValue = (int)startVal; + // 立即刷新一次当前值 + if (ThunderBirdOtaView::GetInstance()) + { + ThunderBirdOtaView::GetInstance()->UpdateCountdown(g_otaCountdownValue); + } + // 创建1s周期定时器 + uint32_t oneSecond = 1000; + g_otaCountdownTimer = osTimerNew((osTimerFunc_t)OtaCountdownTimerCb, osTimerPeriodic, nullptr, nullptr); + if (g_otaCountdownTimer == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartOtaCountdown new timer failed!!"); + return; + } + osStatus_t ret = osTimerStart(g_otaCountdownTimer, oneSecond); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartOtaCountdown start failed, ret = %lx!!", ret); + osTimerDelete(g_otaCountdownTimer); + g_otaCountdownTimer = nullptr; + } + } + + // ---------------------- 通用计时加一定时器(0 -> targetSeconds,每步1秒) ---------------------- + static osTimerId_t g_countUpTimer = nullptr; + static int g_countUpTargetSeconds = 0; + static int g_countUpValue = 0; + static void CountUpTimerProc(uint8_t data) + { + (void)data; + if (g_countUpValue >= g_countUpTargetSeconds) + { + if (g_countUpTimer != nullptr) + { + osTimerStop(g_countUpTimer); + osTimerDelete(g_countUpTimer); + g_countUpTimer = nullptr; + } + return; + } + g_countUpValue += 1; + ThunderBirdLullabyView::GetInstance()->UpdateTimeText(g_countUpValue, g_countUpTargetSeconds); + } + static void CountUpTimerCb(uint8_t data) + { + CountUpTimerProc(data); + } + void ThunderBirdModel::StartCountUpTimer(uint32_t targetSeconds) + { + // 参数保护:至少为1秒 + if (targetSeconds < 1) { targetSeconds = 1; } + // 停止旧定时器 + if (g_countUpTimer != nullptr) + { + osTimerStop(g_countUpTimer); + osStatus_t ret = osTimerDelete(g_countUpTimer); + (void)ret; + g_countUpTimer = nullptr; + } + // 初始化 + g_countUpTargetSeconds = (int)targetSeconds; + g_countUpValue = 0; + // 创建1s周期定时器 + uint32_t oneSecond = 1000; + g_countUpTimer = osTimerNew((osTimerFunc_t)CountUpTimerCb, osTimerPeriodic, nullptr, nullptr); + if (g_countUpTimer == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartCountUpTimer new timer failed!!"); + return; + } + osStatus_t ret = osTimerStart(g_countUpTimer, oneSecond); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartCountUpTimer start failed, ret = %lx!!", ret); + osTimerDelete(g_countUpTimer); + g_countUpTimer = nullptr; + } + } + void ThunderBirdModel::StopCountUpTimer(void) + { + if (g_countUpTimer != nullptr) + { + osTimerStop(g_countUpTimer); + osStatus_t ret = osTimerDelete(g_countUpTimer); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StopCountUpTimer delete failed, ret = %lx!!", ret); + } + g_countUpTimer = nullptr; + } + } + int ThunderBirdModel::GetCountUpValue() const + { + return g_countUpValue; + } + +} diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdOtaView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdOtaView.cpp new file mode 100644 index 000000000..123b6caca --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdOtaView.cpp @@ -0,0 +1,613 @@ +#include "thunderbird/include/ThunderBirdOtaView.h" +#include "thunderbird/include/ThunderBirdModel.h" +#include "wearable_log.h" + +namespace OHOS +{ + static ThunderBirdOtaView *g_pThunderBirdOtaView{nullptr}; + + ThunderBirdOtaView::ThunderBirdOtaView() + { + g_pThunderBirdOtaView = this; + } + + ThunderBirdOtaView::~ThunderBirdOtaView() + { + g_pThunderBirdOtaView = nullptr; + ClearAll(); + } + + ThunderBirdOtaView *ThunderBirdOtaView::GetInstance(void) + { + return g_pThunderBirdOtaView; + } + + void ThunderBirdOtaView::ClearAll(void) + { + if (group != nullptr) + { + group->RemoveAll(); + delete group; + group = nullptr; + } + if (titleLabel != nullptr) { delete titleLabel; titleLabel = nullptr; } + if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } + if (LittleTextLabel != nullptr) { delete LittleTextLabel; LittleTextLabel = nullptr; } + if (LittleTextLabel_2 != nullptr) { delete LittleTextLabel_2; LittleTextLabel_2 = nullptr; } + if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } + if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } + if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } + if (BackGround != nullptr) { delete BackGround; BackGround = nullptr; } + } + + UIViewGroup *ThunderBirdOtaView::ThunderBirdOtaViewInit(void) + { + group = new UIViewGroup(); + if (group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdOtaView::group null!"); + return nullptr; + } + group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + + BackGround = new UIImageView(); + if (BackGround) + { + BackGround->SetAutoEnable(false); + BackGround->SetPosition(0, 0, 466, 466); + BackGround->SetSrc("/user/res/RebootAndShutDown/ReBoot/4.bin"); + BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + BackGround->SetResizeMode(UIImageView::CONTAIN); + BackGround->SetVisible(false); + group->Add(BackGround); + } + + // 公共控件 + TextLabel = new UILabelExt(); + if (TextLabel) + { + TextLabel->SetPosition(0, 104, 466, 48); + TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34); + TextLabel->SetVisible(false); + group->Add(TextLabel); + } + LittleTextLabel = new UILabelExt(); + if (LittleTextLabel) + { + LittleTextLabel->SetPosition(0, 180, 466, 40); + LittleTextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + LittleTextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34); + LittleTextLabel->SetVisible(false); + group->Add(LittleTextLabel); + } + LittleTextLabel_2 = new UILabelExt(); + if (LittleTextLabel_2) + { + LittleTextLabel_2->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + LittleTextLabel_2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + LittleTextLabel_2->SetVisible(false); + group->Add(LittleTextLabel_2); + } + RemindLabel = new UILabelExt(); + if (RemindLabel) + { + RemindLabel->SetPosition(0, 180, 466, 40); + RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); + RemindLabel->SetVisible(false); + group->Add(RemindLabel); + } + RemindIcon = new UIImageView(); + if (RemindIcon) + { + RemindIcon->SetAutoEnable(false); + RemindIcon->SetVisible(false); + group->Add(RemindIcon); + } + RemindIcon2 = new UIImageView(); + if (RemindIcon2) + { + RemindIcon2->SetAutoEnable(false); + RemindIcon2->SetVisible(false); + group->Add(RemindIcon2); + } + RemindIcon3 = new UIImageView(); + if (RemindIcon3) + { + RemindIcon3->SetAutoEnable(false); + RemindIcon3->SetVisible(false); + group->Add(RemindIcon3); + } + VolumeProgress = new UIBoxProgress(); + if (VolumeProgress) + { + VolumeProgress->SetPosition(56, 279, 248, 4); + VolumeProgress->SetRange(100, 0); + VolumeProgress->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 0xff); + VolumeProgress->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, 0xffb4a9a0); + VolumeProgress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + VolumeProgress->SetForegroundStyle(STYLE_TEXT_COLOR, 0xff000000); + VolumeProgress->SetForegroundStyle(STYLE_LINE_COLOR, 0xff45A5FF); + group->Add(VolumeProgress); + } + return group; + } + + void ThunderBirdOtaView::Show(int16_t showView) + { + if (group == nullptr) { return; } + if (BackGround) { BackGround->SetVisible(true);} + if (TextLabel) { TextLabel->SetVisible(false); } + if (LittleTextLabel) + { + LittleTextLabel->SetVisible(false); + LittleTextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + LittleTextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + LittleTextLabel->SetRollSpeed(35); + LittleTextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28); + } + if (LittleTextLabel_2) { LittleTextLabel_2->SetVisible(false);} + if (RemindLabel) { RemindLabel->SetVisible(false);} + if (RemindIcon) { RemindIcon->SetVisible(false); } + if (RemindIcon2) { RemindIcon2->SetVisible(false); } + if (RemindIcon3) { RemindIcon3->SetVisible(false); } + if (VolumeProgress) { VolumeProgress->SetVisible(false); } + switch (showView) + { + case THUNDERBIRD_OTAVIEW_NORMAL: + { + if (TextLabel) + { + TextLabel->SetPosition(45, 102, 270, 42); + TextLabel->SetText("新的体验优化已就绪"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetText("全新功能已推出,现在Amby可以哄你睡觉"); + LittleTextLabel->SetPosition(0, 162, 360, 28); + LittleTextLabel->SetVisible(true); + } + if (LittleTextLabel_2) + { + LittleTextLabel_2->SetPosition(94, 194, 172, 28); + LittleTextLabel_2->SetText("更新预计需要5分钟"); + LittleTextLabel_2->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 更新"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_OBVIOUS: + { + if (TextLabel) + { + TextLabel->SetPosition(66, 102, 240, 42); + TextLabel->SetText("有新功能更新可用"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetText("全新功能已推出,现在Amby可以哄你睡觉"); + LittleTextLabel->SetPosition(0, 162, 360, 28); + LittleTextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + LittleTextLabel->SetVisible(true); + } + if (LittleTextLabel_2) + { + LittleTextLabel_2->SetText("更新预计需要5分钟"); + LittleTextLabel_2->SetPosition(94, 194, 172, 28); + LittleTextLabel_2->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 更新"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_UPDATE_NOW: + { + if (TextLabel) + { + TextLabel->SetPosition(90, 102, 180, 42); + TextLabel->SetText("需要立即更新"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetText("为保障您的产品安全,部分功能将在更新后恢复使用"); + LittleTextLabel->SetPosition(60, 162, 240, 56); + LittleTextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 更新"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_NIGHT_UPDATE: + { + if (TextLabel) + { + TextLabel->SetPosition(45, 102, 270, 42); + TextLabel->SetText("设置夜间更新"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetText("电量>50%,网络正常"); + LittleTextLabel->SetPosition(75, 162, 210, 28); + LittleTextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 确认"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS: + { + if (TextLabel) + { + TextLabel->SetPosition(90, 102, 180, 84); + TextLabel->SetText(" 设定成功! 记得充好电哦"); + TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + TextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(136, 275, 88, 25); + RemindLabel->SetText("按 确认"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(160, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_COUNTDOWN: + { + ThunderBirdModel::GetInstance()->StartOtaCountdown(5); + if (TextLabel) + { + TextLabel->SetPosition(60, 102, 240, 42); + TextLabel->SetText("设备更新即将开始"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetText("5"); + LittleTextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 48); + LittleTextLabel->SetPosition(166, 172, 29, 67); + LittleTextLabel->SetVisible(true); + } + + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 确认"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_LOW_BATTERY: + { + if (TextLabel) + { + TextLabel->SetPosition(82, 124, 240, 42); + TextLabel->SetText("电量不足无法更新"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetText("请至少充至50%电量哦"); + LittleTextLabel->SetPosition(72, 186, 192, 25); + LittleTextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(136, 275, 88, 25); + RemindLabel->SetText("按 退出"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(160, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(38, 127, 36, 36); + RemindIcon2->SetSrc("/user/res/warning.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_NETWORK_ERROR: + { + if (TextLabel) + { + TextLabel->SetText("网络连接异常"); + TextLabel->SetPosition(112, 124, 180, 42); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetText("请检查网络后重试"); + LittleTextLabel->SetPosition(100, 184, 160, 28); + LittleTextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 重试"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + if (RemindIcon3) + { + RemindIcon3->SetPosition(68, 127, 36, 36); + RemindIcon3->SetSrc("/user/res/warning.bin"); + RemindIcon3->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_MEMORY_ERROR: + { + if (TextLabel) + { + TextLabel->SetPosition(82, 124, 240, 42); + TextLabel->SetText("内存不足无法更新"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetText("请及时清理内存空间"); + LittleTextLabel->SetPosition(90, 184, 180, 28); + LittleTextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 清理"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + if (RemindIcon3) + { + RemindIcon3->SetPosition(38, 127, 36, 36); + RemindIcon3->SetSrc("/user/res/warning.bin"); + RemindIcon3->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_UPDATING: + { + if (TextLabel) + { + TextLabel->SetPosition(90, 108, 120, 42); + TextLabel->SetText("更新中"); + TextLabel->SetVisible(true); + } + if (VolumeProgress) + { + VolumeProgress->SetVisible(true); + } + if(LittleTextLabel) + { + LittleTextLabel->SetPosition(56, 243, 44, 28); + LittleTextLabel->SetText((std::to_string(remindProgressValue_) + "%").c_str()); + LittleTextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(198, 246, 106, 22); + RemindLabel->SetText("更新预计需要5分钟"); + RemindLabel->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS: + { + if (TextLabel) + { + TextLabel->SetPosition(142, 122, 164, 42); + TextLabel->SetText("更新成功"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetPosition(80, 184, 220, 28); + LittleTextLabel->SetText("你的设备已是最新版本"); + LittleTextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(136, 275, 88, 25); + RemindLabel->SetText("按 确认"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(160, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_up.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(98, 125, 36, 36); + RemindIcon2->SetSrc("/user/res/completed.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_OTAVIEW_UPDATE_FAILED: + { + if (TextLabel) + { + TextLabel->SetPosition(127, 122, 150, 42); + TextLabel->SetText("更新未完成"); + TextLabel->SetVisible(true); + } + if (LittleTextLabel) + { + LittleTextLabel->SetPosition(70, 184, 220, 28); + LittleTextLabel->SetText("请检查网络和电量后重试"); + LittleTextLabel->SetVisible(true); + } + if (RemindLabel) + { + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 重试"); + RemindLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(104, 277, 22, 22); + RemindIcon->SetSrc("/user/res/volume_down.bin"); + RemindIcon->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + if (RemindIcon3) + { + RemindIcon3->SetPosition(83, 125, 36, 36); + RemindIcon3->SetSrc("/user/res/completed.bin"); + RemindIcon3->SetVisible(true); + } + break; + } + default: + break; + } + } + + void ThunderBirdOtaView::UpdateCountdown(int value)//更新倒计时 + { + if (LittleTextLabel == nullptr) + { + return; + } + if (value < 1) { value = 1; } + if (value > 5) { value = 5; } + LittleTextLabel->SetText(std::to_string(value).c_str()); + LittleTextLabel->Invalidate(); + } + + void ThunderBirdOtaView::SetRemindProgress(int16_t value)//更新进度 + { + if (VolumeProgress == nullptr) + { + return; + } + int newVal = remindProgressValue_ + value; + if (newVal < 0) { newVal = 0; } + if (newVal > 100) { newVal = 100; } + remindProgressValue_ = newVal; + VolumeProgress->SetValue(remindProgressValue_); + VolumeProgress->Invalidate(); + } +} + + diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp similarity index 80% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp index 2184d908b..a40f820bc 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp @@ -17,7 +17,7 @@ #include "common/key_code.h" #include #include "NativeRegisterManager.h" -#include "uicomponents/UIComponents.h" +//#include "uicomponents/UIComponents.h" #include "broadcast_feature.h" #include "broadcast_service.h" #include "samgr_lite.h" @@ -102,6 +102,15 @@ namespace OHOS Presenter::OnStart(); } + void ThunderBirdPresenter::OnResume() + { + Presenter::OnResume(); + //统一抢回 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)ThunderBirdPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdPresenter::OnResume reset key listener"); + } + bool ThunderBirdPresenter::OnDrag(UIView &view, const DragEvent &event) { @@ -120,7 +129,7 @@ namespace OHOS UNUSED(event); if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && ThunderBirdPresenter::X_DRAG_FLAG) { - NativeAbility::GetInstance().Back(); + //NativeAbility::GetInstance().Back(); ThunderBirdPresenter::X_DRAG_FLAG = false; } return true; @@ -131,14 +140,14 @@ namespace OHOS UNUSED(event); - NativeAbility::GetInstance().Back(); + //NativeAbility::GetInstance().Back(); return true; } // 增加按键事件 bool ThunderBirdPresenter::OnKeyAct(UIView &view, const KeyEvent &event) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdPresenter::OnKeyAct"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdPresenter::OnKeyAct"); uint16_t keyID = event.GetKeyId(); uint16_t keyState = event.GetState(); // 如果是power键就返回上一级 @@ -146,6 +155,25 @@ namespace OHOS { int16_t currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); int16_t currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "currentView = %d, currentSubView = %d", currentView, currentSubView); + // 音量界面:电源键 +10 + if (currentView == THUNDERBIRD_DIALOGUEVIEW) + { + ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000); + ThunderBirdMainView::GetInstance()->ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW);//不走ChangeView + // if (ThunderBirdReminderView::GetInstance()) + // { + // ThunderBirdReminderView::GetInstance()->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_VOLUME); + // ThunderBirdReminderView::GetInstance()->AdjustRemindProgress(10); + // ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000); + // } + if (ThunderBirdReminderView::GetInstance()) + { + ThunderBirdReminderView::GetInstance()->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT); + } + + return true; + } // 引导界面导航 if(currentView == THUNDERBIRD_GUIDEVIEW) { @@ -159,18 +187,18 @@ namespace OHOS } else if(currentSubView == ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3) { - ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_READY); + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL); } } // OTA界面导航 else if(currentView == THUNDERBIRD_OTAVIEW) { - if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_READY) // 有新功能 + if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL) // 有新功能 { - ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NEW_FEATURE); + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_OBVIOUS); } - else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NEW_FEATURE) // 需要立即更新 + else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_OBVIOUS) // 需要立即更新 { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_NOW); } @@ -198,18 +226,22 @@ namespace OHOS { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_MEMORY_ERROR); } - else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_MEMORY_ERROR) // 更新成功 + else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_MEMORY_ERROR) // 内存不足 { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS); } - else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS) // 更新未完成 + else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS) // 更新成功 { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED); } - else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED) // 更新未完成 + else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED) // 更新失败 { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1); } + else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATING) // 更新中 + { + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS); + } } // 哄睡界面导航 @@ -296,12 +328,31 @@ namespace OHOS } else if(currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_NETWORK_CONNECTING) // 网络连接中 { - ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_SHUTDOWNVIEW, 0); + // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_SHUTDOWNVIEW, 0); + ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_SHUTDOWNTESTVIEW, -1); } } } if(keyID == static_cast(ZliteKeyCode::ZLITE_KEY_FUNC) && keyState == 1 && uapi_get_screen_state() == 0) { + int16_t currentView = ThunderBirdMainView::GetInstance()->GetCurrentView(); + int16_t currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView(); + // 音量界面:FUNC 键 -10 + if (currentView == THUNDERBIRD_DIALOGUEVIEW || + (currentView == THUNDERBIRD_LULLABYVIEW && + (currentSubView == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1 || + currentSubView == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4))) //只有在对话界面还有哄睡界面才触发 + { + ThunderBirdMainView::GetInstance()->ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW);//不走ChangeView + if (ThunderBirdReminderView::GetInstance()) + { + ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000); + ThunderBirdReminderView::GetInstance()->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_VOLUME); + ThunderBirdReminderView::GetInstance()->AdjustRemindProgress(-10); + + } + return true; + } // // 发布OTA升级事件,显示OTA升级弹窗 // PublishEvent(TOPIC_EVENT_OTA_UPDATE, nullptr, 0); // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdPresenter: Published OTA update event"); diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp new file mode 100644 index 000000000..6ddc38e04 --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdReminderView.cpp @@ -0,0 +1,414 @@ +#include "thunderbird/include/ThunderBirdReminderView.h" +#include "wearable_log.h" +#include "thunderbird/include/ThunderBirdMainView.h" +#include "battery_hal.h" +#include "battery_service.h" +namespace OHOS +{ + static ThunderBirdReminderView *g_pThunderBirdReminderView{nullptr}; + + ThunderBirdReminderView::ThunderBirdReminderView() + { + g_pThunderBirdReminderView = this; + } + + ThunderBirdReminderView::~ThunderBirdReminderView() + { + g_pThunderBirdReminderView = nullptr; + ClearAll(); + } + + ThunderBirdReminderView *ThunderBirdReminderView::GetInstance(void) + { + return g_pThunderBirdReminderView; + } + + void ThunderBirdReminderView::ClearAll(void) + { + if (group != nullptr) + { + group->RemoveAll(); + delete group; + group = nullptr; + } + if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } + if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; } + if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; } + if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; } + } + + UIViewGroup *ThunderBirdReminderView::ThunderBirdReminderViewInit(void) + { + group = new UIViewGroup(); + if (group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdReminderView::group null!"); + return nullptr; + } + group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + group->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + // 公共控件 + TextLabel = new UILabelExt(); + if (TextLabel) + { + TextLabel->SetVisible(false); + group->Add(TextLabel); + } + if(RemindLabel) + { + RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindLabel->SetVisible(false); + group->Add(RemindLabel); + } + RemindButton = new UILabelButton(); + if (RemindButton) + { + RemindButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff635d58, UIButton::RELEASED); + RemindButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff7c7773, UIButton::RELEASED); + RemindButton->SetStyleForState(STYLE_BORDER_WIDTH, 2, UIButton::RELEASED); + RemindButton->SetVisible(false); + group->Add(RemindButton); + } + RemindIcon = new UIImageView(); + if (RemindIcon) + { + RemindIcon->SetAutoEnable(false); + RemindIcon->SetVisible(false); + group->Add(RemindIcon); + } + RemindIcon2 = new UIImageView(); + if (RemindIcon2) + { + RemindIcon2->SetAutoEnable(false); + RemindIcon2->SetVisible(false); + group->Add(RemindIcon2); + } + VolumeProgress = new UIBoxProgress(); + if (VolumeProgress) + { + VolumeProgress->SetPosition(118, 132, 124, 4); + VolumeProgress->SetRange(100, 0); + VolumeProgress->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 0xff); + VolumeProgress->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, 0xffb4a9a0); + VolumeProgress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + VolumeProgress->SetForegroundStyle(STYLE_TEXT_COLOR, 0xff000000); + VolumeProgress->SetForegroundStyle(STYLE_LINE_COLOR, 0xff45A5FF); + group->Add(VolumeProgress); + } + return group; + } + + void ThunderBirdReminderView::Show(int16_t showView) + { + if (group == nullptr) { return; } + if (TextLabel) { TextLabel->SetVisible(false); } + if (RemindLabel) { RemindLabel->SetVisible(false); } + if (RemindButton) { RemindButton->SetVisible(false); } + if (RemindIcon) { RemindIcon->SetVisible(false); RemindIcon->SetStyle(STYLE_BACKGROUND_OPA, 0x00);} + if (RemindIcon2) { RemindIcon2->SetVisible(false); } + if (VolumeProgress) { VolumeProgress->SetVisible(false); } + + + switch (showView) + { + case THUNDERBIRD_REMINDERVIEW_VOLUME: + { + if (RemindButton) + { + RemindButton->SetPosition(102, 114, 156, 40); + RemindButton->SetText(""); + RemindButton->SetVisible(true); + } + if (VolumeProgress) + { + VolumeProgress->SetVisible(true); + } + break; + } + case THUNDERBIRD_REMINDERVIEW_TASK_REMINDER: + { + if (TextLabel) + { + TextLabel->SetPosition(99, 64, 261, 42); + TextLabel->SetText("11点了该睡觉了"); + TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); + TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + TextLabel->SetRollSpeed(35); + TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + TextLabel->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(57, 67, 36, 36); + RemindIcon->SetSrc("/user/res/notification.bin"); + RemindIcon->SetVisible(true); + } + if (RemindButton) + { + RemindButton->SetPosition(102, 114, 168, 40); + RemindButton->SetText("按 关闭通知"); + RemindButton->SetLabelPosition(16, 6); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + if (RemindIcon2) + { + RemindIcon2->SetPosition(144, 122, 24, 24); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT: + { + if (RemindButton) + { + RemindButton->SetPosition(99, 114, 185, 59); + RemindButton->SetText("网络已断开"); + RemindButton->SetLabelPosition(69, 16); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(115, 120, 47, 47); + RemindIcon->SetSrc("/user/res/no_network.bin"); + RemindIcon->SetVisible(true); + } + break; + } + case THUNDERBIRD_REMINDERVIEW_LOW_BATTERY: + { + if (RemindButton) + { + RemindButton->SetPosition(103, 114, 185, 40); + RemindButton->SetLabelPosition(46, 6); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(103, 122, 23, 23); + RemindIcon->SetSrc("/user/res/no_network.bin"); + RemindIcon->SetVisible(true); + } + if(RemindLabel) + { + if (ThunderBirdMainView::GetInstance()->Batteryvalue <= 20 && ThunderBirdMainView::GetInstance()->Batteryvalue > 10) + { + RemindButton->SetText(" 电量不足20%"); + } + else if (ThunderBirdMainView::GetInstance()->Batteryvalue <= 10 && ThunderBirdMainView::GetInstance()->Batteryvalue > 5) + { + RemindButton->SetText(" 电量不足10%"); + } + else if (ThunderBirdMainView::GetInstance()->Batteryvalue <= 5) + { + RemindButton->SetText(" 电量不足5%"); + } + } + + break; + } + case THUNDERBIRD_REMINDERVIEW_CHARGING: + { + if (RemindButton) + { + RemindButton->SetPosition(119, 116, 121, 40); + RemindButton->SetText("充电中"); + RemindButton->SetLabelPosition(46, 6); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(135, 124, 23, 23); + RemindIcon->SetSrc("/user/res/no_network.bin"); + RemindIcon->SetVisible(true); + } + break; + } + case THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE: + { + if (RemindButton) + { + RemindButton->SetPosition(109, 116, 141, 40); + RemindButton->SetText("充电完成"); + RemindButton->SetLabelPosition(46, 6); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + if (RemindIcon) + { + RemindIcon->SetPosition(125, 124, 23, 23); + RemindIcon->SetSrc("/user/res/no_network.bin"); + RemindIcon->SetVisible(true); + } + + break; + } + case THUNDERBIRD_REMINDERVIEW_DIALOGUE_NOT_ENOUGH: + { + ThunderBirdMainView::GetInstance()->OpenBackGround(); + if(TextLabel) + { + TextLabel->SetPosition(57, 69, 246, 84); + TextLabel->SetText("对话额度不足20轮可扫码续充"); + TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + TextLabel->SetVisible(true); + } + if(RemindIcon) + { + RemindIcon->SetPosition(133, 169, 94, 94); + RemindIcon->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + RemindIcon->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + //RemindIcon->SetSrc("/user/res/volume_up.bin"); + RemindIcon->SetVisible(true); + } + if(RemindLabel) + { + RemindLabel->SetPosition(132, 296, 96, 28); + RemindLabel->SetText("按 确认"); + RemindLabel->SetVisible(true); + } + if(RemindIcon2) + { + RemindIcon2->SetPosition(158, 298, 24, 24); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_REMINDERVIEW_DIALOGUE_USE_UP: + { + ThunderBirdMainView::GetInstance()->OpenBackGround(); + if(TextLabel) + { + TextLabel->SetPosition(47, 64, 266, 84); + TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + TextLabel->SetText("啊哦,对话轮数已用完,扫码续上吧"); + TextLabel->SetVisible(true); + } + if(RemindIcon) + { + RemindIcon->SetPosition(133, 169, 94, 94); + RemindIcon->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + RemindIcon->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + //RemindIcon->SetSrc("/user/res/volume_up.bin"); + RemindIcon->SetVisible(true); + } + if(RemindLabel) + { + RemindLabel->SetPosition(132, 296, 96, 28); + RemindLabel->SetText("按 确认"); + RemindLabel->SetVisible(true); + } + if(RemindIcon2) + { + RemindIcon2->SetPosition(158, 298, 24, 24); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_REMINDERVIEW_FLOW_NOT_ENOUGH: + { + ThunderBirdMainView::GetInstance()->OpenBackGround(); + if(TextLabel) + { + TextLabel->SetPosition(47, 64, 266, 84); + TextLabel->SetText("流量不足100M了哦扫码可重置流量"); + TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + TextLabel->SetVisible(true); + } + if(RemindIcon) + { + RemindIcon->SetPosition(133, 169, 94, 94); + RemindIcon->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + RemindIcon->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + //RemindIcon->SetSrc("/user/res/volume_up.bin"); + RemindIcon->SetVisible(true); + } + if(RemindLabel) + { + RemindLabel->SetPosition(132, 296, 96, 28); + RemindLabel->SetText("按 确认"); + RemindLabel->SetVisible(true); + } + if(RemindIcon2) + { + RemindIcon2->SetPosition(158, 298, 24, 24); + RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetVisible(true); + } + break; + } + case THUNDERBIRD_REMINDERVIEW_FLOW_USE_UP: + { + if(TextLabel) + { + TextLabel->SetPosition(91, 64, 180, 42); + TextLabel->SetText("流量用完了哦"); + TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + TextLabel->SetVisible(true); + } + if (RemindButton) + { + RemindButton->SetPosition(64, 114, 232, 40); + RemindButton->SetText("可在小程序上续费使用"); + RemindButton->SetLabelPosition(46, 6); + RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + RemindButton->SetVisible(true); + } + break; + } + default: + break; + } + } + + void ThunderBirdReminderView::HideAll() + { + if (group == nullptr) { return; } + if (RemindButton) { RemindButton->SetVisible(false); } + if (TextLabel) { TextLabel->SetVisible(false); } + if (RemindLabel) { RemindLabel->SetVisible(false); } + if (RemindIcon) { RemindIcon->SetVisible(false); } + if (RemindIcon2) { RemindIcon2->SetVisible(false); } + if (VolumeProgress) { VolumeProgress->SetVisible(false); } + group->Invalidate(); + } + + void ThunderBirdReminderView::SetRemindProgress(int16_t value) + { + if (VolumeProgress == nullptr) + { + return; + } + if (value < 0) { value = 0; } + if (value > 100) { value = 100; } + remindProgressValue_ = value; + VolumeProgress->SetValue(remindProgressValue_); + VolumeProgress->Invalidate(); + } + + void ThunderBirdReminderView::AdjustRemindProgress(int16_t delta) + { + if (VolumeProgress == nullptr) + { + return; + } + int16_t newVal = remindProgressValue_ + delta; + SetRemindProgress(newVal); + // 若当前处于音量界面,确保控件可见 + if (RemindButton) { RemindButton->SetVisible(true); } + } + +} + + diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownTestView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownTestView.cpp new file mode 100644 index 000000000..54a1f2888 --- /dev/null +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownTestView.cpp @@ -0,0 +1,148 @@ +#include "thunderbird/include/ThunderBirdShutdownTestView.h" +//#include "uicomponents/UIComponents.h" +#include "wearable_log.h" +#include "custom_utils.h" +#include "thunderbird/include/ThunderBirdMainView.h" +#include "UiConfig.h" + +namespace OHOS +{ + static ThunderBirdShutdownTestView *g_tbShutdownTestView{nullptr}; + static const char *TB_NAUGHTY_PATHS[TB_SHUTDOWN_ANIM_FRAMES_TEST] = { + TB_NAUGHTY_IMAGE_1, TB_NAUGHTY_IMAGE_2, TB_NAUGHTY_IMAGE_3, TB_NAUGHTY_IMAGE_4, TB_NAUGHTY_IMAGE_5, + TB_NAUGHTY_IMAGE_6, TB_NAUGHTY_IMAGE_7, TB_NAUGHTY_IMAGE_8, TB_NAUGHTY_IMAGE_9, TB_NAUGHTY_IMAGE_10, + TB_NAUGHTY_IMAGE_11, TB_NAUGHTY_IMAGE_12, TB_NAUGHTY_IMAGE_13, TB_NAUGHTY_IMAGE_14, TB_NAUGHTY_IMAGE_15, + TB_NAUGHTY_IMAGE_16, TB_NAUGHTY_IMAGE_17, TB_NAUGHTY_IMAGE_18, TB_NAUGHTY_IMAGE_19, TB_NAUGHTY_IMAGE_20, + TB_NAUGHTY_IMAGE_21, TB_NAUGHTY_IMAGE_22, TB_NAUGHTY_IMAGE_23, TB_NAUGHTY_IMAGE_24, TB_NAUGHTY_IMAGE_25, + TB_NAUGHTY_IMAGE_26, TB_NAUGHTY_IMAGE_27, TB_NAUGHTY_IMAGE_28, TB_NAUGHTY_IMAGE_29, TB_NAUGHTY_IMAGE_30, + TB_NAUGHTY_IMAGE_31, TB_NAUGHTY_IMAGE_32, TB_NAUGHTY_IMAGE_33, TB_NAUGHTY_IMAGE_34, TB_NAUGHTY_IMAGE_35, + TB_NAUGHTY_IMAGE_36, TB_NAUGHTY_IMAGE_37, TB_NAUGHTY_IMAGE_38, TB_NAUGHTY_IMAGE_39, TB_NAUGHTY_IMAGE_40, + TB_NAUGHTY_IMAGE_41, TB_NAUGHTY_IMAGE_42, TB_NAUGHTY_IMAGE_43, TB_NAUGHTY_IMAGE_44, TB_NAUGHTY_IMAGE_45, + TB_NAUGHTY_IMAGE_46, TB_NAUGHTY_IMAGE_47, TB_NAUGHTY_IMAGE_48, TB_NAUGHTY_IMAGE_49, TB_NAUGHTY_IMAGE_50, + TB_NAUGHTY_IMAGE_51, TB_NAUGHTY_IMAGE_52, TB_NAUGHTY_IMAGE_53, TB_NAUGHTY_IMAGE_54, TB_NAUGHTY_IMAGE_55, + TB_NAUGHTY_IMAGE_56, TB_NAUGHTY_IMAGE_57, TB_NAUGHTY_IMAGE_58, TB_NAUGHTY_IMAGE_59, TB_NAUGHTY_IMAGE_60, + TB_NAUGHTY_IMAGE_61, TB_NAUGHTY_IMAGE_62, TB_NAUGHTY_IMAGE_63, TB_NAUGHTY_IMAGE_64, TB_NAUGHTY_IMAGE_65, + TB_NAUGHTY_IMAGE_66, TB_NAUGHTY_IMAGE_67, TB_NAUGHTY_IMAGE_68, TB_NAUGHTY_IMAGE_69, TB_NAUGHTY_IMAGE_70, + TB_NAUGHTY_IMAGE_71, TB_NAUGHTY_IMAGE_72, TB_NAUGHTY_IMAGE_73, TB_NAUGHTY_IMAGE_74, TB_NAUGHTY_IMAGE_75, + TB_NAUGHTY_IMAGE_76, TB_NAUGHTY_IMAGE_77, TB_NAUGHTY_IMAGE_78, TB_NAUGHTY_IMAGE_79, TB_NAUGHTY_IMAGE_80, + TB_NAUGHTY_IMAGE_81, TB_NAUGHTY_IMAGE_82, TB_NAUGHTY_IMAGE_83, TB_NAUGHTY_IMAGE_84, TB_NAUGHTY_IMAGE_85, + TB_NAUGHTY_IMAGE_86, + }; + ThunderBirdShutdownTestView::ThunderBirdShutdownTestView() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownTestView::ThunderBirdShutdownTestView"); + if (ThunderBirdMainView::GetInstance()) + { + // ThunderBirdMainView::GetInstance()->CloseVideo(); + ThunderBirdMainView::GetInstance()->videoPlay_->StopVideoPlay(); + } + g_tbShutdownTestView = this; + } + + ThunderBirdShutdownTestView::~ThunderBirdShutdownTestView() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownTestView::~ThunderBirdShutdownTestView"); + ClearAll(); + g_tbShutdownTestView = nullptr; + } + ThunderBirdShutdownTestView *ThunderBirdShutdownTestView::GetInstance() + { + return g_tbShutdownTestView; + } + + void ThunderBirdShutdownTestView::ClearAll() + { + if (group != nullptr) + { + group->RemoveAll(); + if (animator != nullptr) + { + delete animator; + animator = nullptr; + } + //FreeImagePathsArray(pathsArray, TB_SHUTDOWN_ANIM_FRAMES_TEST); + delete group; + group = nullptr; + } + } + + bool ThunderBirdShutdownTestView::EnsureAnimator() + { + if (animator == nullptr) + { + pathsArray = TB_NAUGHTY_PATHS; + animator = new UIImageAnimatorView(); + if (animator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownTestView new UIImageAnimatorView fail"); + return false; + } + animator->SetAutoEnable(false); + for (uint8_t i = 0; i < TB_SHUTDOWN_ANIM_FRAMES_TEST; i++) + { + imageInfos[i].imagePath = (pathsArray[i]); + imageInfos[i].imageType = IMG_SRC_FILE_PATH; + imageInfos[i].pos.x = TB_SHUTDOWN_ANIM_X_TEST; + imageInfos[i].pos.y = TB_SHUTDOWN_ANIM_Y_TEST; + imageInfos[i].width = TB_SHUTDOWN_ANIM_W_TEST; + imageInfos[i].height = TB_SHUTDOWN_ANIM_H_TEST; + } + animator->SetPosition(TB_SHUTDOWN_ANIM_X_TEST, TB_SHUTDOWN_ANIM_Y_TEST, TB_SHUTDOWN_ANIM_W_TEST, TB_SHUTDOWN_ANIM_H_TEST); + animator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + animator->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + animator->SetImageAnimatorSrc(imageInfos, TB_SHUTDOWN_ANIM_FRAMES_TEST, TB_SHUTDOWN_ANIM_INTERVAL_TEST); + animator->SetRepeat(true); + animator->SetRepeatTimes(1); + animator->SetResizeMode(UIImageView::COVER); + //animator->SetAnimatorStopListener(this); + } + return true; + } + + UIViewGroup *ThunderBirdShutdownTestView::Init() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownTestView::Init"); + group = new UIViewGroup(); + if (group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownTestView group new fail"); + return nullptr; + } + group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + if (!EnsureAnimator()) + { + return nullptr; + } + group->Add(animator); + iconView = new UIImageView(); + iconView->SetPosition(0, 0, 466, 466); + iconView->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + iconView->SetStyle(STYLE_BACKGROUND_OPA, 0x66); + iconView->SetVisible(false); + group->Add(iconView); + return group; + } + + UIImageAnimatorView *ThunderBirdShutdownTestView::GetAnimator() + { + return animator; + } + + void ThunderBirdShutdownTestView::StartAnimation() + { + if (!EnsureAnimator()) + { + return; + } + animator->Start(); + } + + void ThunderBirdShutdownTestView::OnAnimatorStop(UIView &view) + { + UNUSED(view); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownTestView::OnAnimatorStop"); + // No shutdown side effects in test view + } +} + + diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownView.cpp similarity index 57% rename from code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownView.cpp rename to code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownView.cpp index 38fe42680..69ebfd315 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdShutdownView.cpp @@ -1,20 +1,48 @@ #include "thunderbird/include/ThunderBirdShutdownView.h" -#include "uicomponents/UIComponents.h" +//#include "uicomponents/UIComponents.h" #include "wearable_log.h" #include "custom_runtime.h" #include "custom_utils.h" -#include "uiservice/include/ui_service.h" +//#include "uiservice/include/ui_service.h" #include "vibrator_service.h" #include "thunderbird/include/ThunderBirdMainView.h" +#include "UiConfig.h" namespace OHOS { static ThunderBirdShutdownView *g_tbShutdownView{nullptr}; + static const char *TB_SHUTDOWN_PATHS[TB_SHUTDOWN_ANIM_FRAMES] = { + TB_SHUTDOWN_IMAGE_1, TB_SHUTDOWN_IMAGE_2, TB_SHUTDOWN_IMAGE_3, TB_SHUTDOWN_IMAGE_4, TB_SHUTDOWN_IMAGE_5, + TB_SHUTDOWN_IMAGE_6, TB_SHUTDOWN_IMAGE_7, TB_SHUTDOWN_IMAGE_8, TB_SHUTDOWN_IMAGE_9, TB_SHUTDOWN_IMAGE_10, + TB_SHUTDOWN_IMAGE_11, TB_SHUTDOWN_IMAGE_12, TB_SHUTDOWN_IMAGE_13, TB_SHUTDOWN_IMAGE_14, TB_SHUTDOWN_IMAGE_15, + TB_SHUTDOWN_IMAGE_16, TB_SHUTDOWN_IMAGE_17, TB_SHUTDOWN_IMAGE_18, TB_SHUTDOWN_IMAGE_19, TB_SHUTDOWN_IMAGE_20, + TB_SHUTDOWN_IMAGE_21, TB_SHUTDOWN_IMAGE_22, TB_SHUTDOWN_IMAGE_23, TB_SHUTDOWN_IMAGE_24, TB_SHUTDOWN_IMAGE_25, + TB_SHUTDOWN_IMAGE_26, TB_SHUTDOWN_IMAGE_27, TB_SHUTDOWN_IMAGE_28, TB_SHUTDOWN_IMAGE_29, TB_SHUTDOWN_IMAGE_30, + TB_SHUTDOWN_IMAGE_31, TB_SHUTDOWN_IMAGE_32, TB_SHUTDOWN_IMAGE_33, TB_SHUTDOWN_IMAGE_34, TB_SHUTDOWN_IMAGE_35, + TB_SHUTDOWN_IMAGE_36, TB_SHUTDOWN_IMAGE_37, TB_SHUTDOWN_IMAGE_38, TB_SHUTDOWN_IMAGE_39, TB_SHUTDOWN_IMAGE_40, + TB_SHUTDOWN_IMAGE_41, TB_SHUTDOWN_IMAGE_42, TB_SHUTDOWN_IMAGE_43, TB_SHUTDOWN_IMAGE_44, TB_SHUTDOWN_IMAGE_45, + TB_SHUTDOWN_IMAGE_46, TB_SHUTDOWN_IMAGE_47, TB_SHUTDOWN_IMAGE_48, TB_SHUTDOWN_IMAGE_49, TB_SHUTDOWN_IMAGE_50, + TB_SHUTDOWN_IMAGE_51, TB_SHUTDOWN_IMAGE_52, TB_SHUTDOWN_IMAGE_53, TB_SHUTDOWN_IMAGE_54, TB_SHUTDOWN_IMAGE_55, + TB_SHUTDOWN_IMAGE_56, TB_SHUTDOWN_IMAGE_57, TB_SHUTDOWN_IMAGE_58, TB_SHUTDOWN_IMAGE_59, TB_SHUTDOWN_IMAGE_60, + TB_SHUTDOWN_IMAGE_61, TB_SHUTDOWN_IMAGE_62, TB_SHUTDOWN_IMAGE_63, TB_SHUTDOWN_IMAGE_64, TB_SHUTDOWN_IMAGE_65, + TB_SHUTDOWN_IMAGE_66, TB_SHUTDOWN_IMAGE_67, TB_SHUTDOWN_IMAGE_68, TB_SHUTDOWN_IMAGE_69, TB_SHUTDOWN_IMAGE_70, + TB_SHUTDOWN_IMAGE_71, TB_SHUTDOWN_IMAGE_72, TB_SHUTDOWN_IMAGE_73, TB_SHUTDOWN_IMAGE_74, TB_SHUTDOWN_IMAGE_75, + TB_SHUTDOWN_IMAGE_76, TB_SHUTDOWN_IMAGE_77, TB_SHUTDOWN_IMAGE_78, TB_SHUTDOWN_IMAGE_79, TB_SHUTDOWN_IMAGE_80, + TB_SHUTDOWN_IMAGE_81, TB_SHUTDOWN_IMAGE_82, TB_SHUTDOWN_IMAGE_83, TB_SHUTDOWN_IMAGE_84, TB_SHUTDOWN_IMAGE_85, + TB_SHUTDOWN_IMAGE_86, TB_SHUTDOWN_IMAGE_87, TB_SHUTDOWN_IMAGE_88, TB_SHUTDOWN_IMAGE_89, TB_SHUTDOWN_IMAGE_90, + TB_SHUTDOWN_IMAGE_91, TB_SHUTDOWN_IMAGE_92, TB_SHUTDOWN_IMAGE_93, TB_SHUTDOWN_IMAGE_94, TB_SHUTDOWN_IMAGE_95, + }; ThunderBirdShutdownView::ThunderBirdShutdownView() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownView::ThunderBirdShutdownView"); g_tbShutdownView = this; + // 关机前释放 thunderbird 视频与相关资源 + if (ThunderBirdMainView::GetInstance()) + { + // ThunderBirdMainView::GetInstance()->CloseVideo(); + ThunderBirdMainView::GetInstance()->videoPlay_->StopVideoPlay(); + } } ThunderBirdShutdownView::~ThunderBirdShutdownView() @@ -39,7 +67,7 @@ namespace OHOS delete shutdownAnimator; shutdownAnimator = nullptr; } - FreeImagePathsArray(shutdownPathsArray, TB_SHUTDOWN_ANIM_FRAMES); + //FreeImagePathsArray(shutdownPathsArray, TB_SHUTDOWN_ANIM_FRAMES); delete group; group = nullptr; } @@ -49,11 +77,6 @@ namespace OHOS { UNUSED(view); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownView::OnAnimatorStop"); - // 关机前释放 thunderbird 视频与相关资源 - if (ThunderBirdMainView::GetInstance()) - { - ThunderBirdMainView::GetInstance()->CloseVideo(); - } shutdown_reboot_prejobs(SHUTDOWN_TYPE); } @@ -61,7 +84,7 @@ namespace OHOS { if (shutdownAnimator == nullptr) { - shutdownPathsArray = CreateImagePathsArray(TB_SHUTDOWN_ANIM_PATH, TB_SHUTDOWN_ANIM_FRAMES); + shutdownPathsArray = TB_SHUTDOWN_PATHS; shutdownAnimator = new UIImageAnimatorView(); if (shutdownAnimator == nullptr) { @@ -85,7 +108,7 @@ namespace OHOS shutdownAnimator->SetRepeat(false); shutdownAnimator->SetRepeatTimes(1); shutdownAnimator->SetResizeMode(UIImageView::COVER); - shutdownAnimator->SetAnimatorStopListener(this); + //shutdownAnimator->SetAnimatorStopListener(this); } return true; } @@ -121,7 +144,7 @@ namespace OHOS } shutdownAnimator->Start(); uapi_dev_runtime_set_shutting_down_status(1); - ScreenOffEnable(false); + //ScreenOffEnable(false); uapi_set_screen_on_api(); custom_VibratorFunc_int(0); } diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/1.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/1.bin new file mode 100644 index 000000000..13e91ae48 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/1.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/10.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/10.bin new file mode 100644 index 000000000..a47b1eb5d Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/10.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/11.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/11.bin new file mode 100644 index 000000000..c1d25bd24 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/11.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/12.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/12.bin new file mode 100644 index 000000000..d6480a025 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/12.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/13.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/13.bin new file mode 100644 index 000000000..9ca01db8b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/13.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/14.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/14.bin new file mode 100644 index 000000000..f09cc925a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/14.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/15.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/15.bin new file mode 100644 index 000000000..ad4903b12 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/15.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/16.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/16.bin new file mode 100644 index 000000000..d158b62db Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/16.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/17.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/17.bin new file mode 100644 index 000000000..3fe17fc2e Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/17.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/18.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/18.bin new file mode 100644 index 000000000..d2a35ff9f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/18.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/19.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/19.bin new file mode 100644 index 000000000..7f7c46d2e Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/19.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/2.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/2.bin new file mode 100644 index 000000000..59183cb85 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/2.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/20.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/20.bin new file mode 100644 index 000000000..a1d182800 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/20.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/21.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/21.bin new file mode 100644 index 000000000..88776a618 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/21.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/22.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/22.bin new file mode 100644 index 000000000..94ddd7c59 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/22.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/23.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/23.bin new file mode 100644 index 000000000..10bf768be Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/23.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/24.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/24.bin new file mode 100644 index 000000000..fdfe35243 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/24.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/25.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/25.bin new file mode 100644 index 000000000..7a12af3c4 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/25.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/26.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/26.bin new file mode 100644 index 000000000..8b1e90452 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/26.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/27.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/27.bin new file mode 100644 index 000000000..0498fddb5 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/27.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/28.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/28.bin new file mode 100644 index 000000000..9f1245c2c Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/28.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/29.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/29.bin new file mode 100644 index 000000000..23da3d1a9 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/29.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/3.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/3.bin new file mode 100644 index 000000000..9f09247b0 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/3.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/30.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/30.bin new file mode 100644 index 000000000..f0aab6574 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/30.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/31.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/31.bin new file mode 100644 index 000000000..f3058a5d8 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/31.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/32.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/32.bin new file mode 100644 index 000000000..931055524 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/32.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/33.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/33.bin new file mode 100644 index 000000000..b627e74cf Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/33.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/34.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/34.bin new file mode 100644 index 000000000..129f85d20 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/34.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/35.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/35.bin new file mode 100644 index 000000000..fe3115cc0 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/35.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/36.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/36.bin new file mode 100644 index 000000000..81fc80c6b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/36.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/37.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/37.bin new file mode 100644 index 000000000..e6b252a07 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/37.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/38.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/38.bin new file mode 100644 index 000000000..ea34d597a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/38.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/39.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/39.bin new file mode 100644 index 000000000..962b682db Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/39.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/4.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/4.bin new file mode 100644 index 000000000..e2b8db73e Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/4.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/40.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/40.bin new file mode 100644 index 000000000..9cb5006d6 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/40.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/41.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/41.bin new file mode 100644 index 000000000..69f5855cb Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/41.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/42.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/42.bin new file mode 100644 index 000000000..57c1d2f5e Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/42.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/43.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/43.bin new file mode 100644 index 000000000..ef0ded32b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/43.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/44.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/44.bin new file mode 100644 index 000000000..50d734b9f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/44.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/45.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/45.bin new file mode 100644 index 000000000..d7362d710 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/45.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/46.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/46.bin new file mode 100644 index 000000000..0e46788d9 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/46.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/47.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/47.bin new file mode 100644 index 000000000..a8f69730a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/47.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/48.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/48.bin new file mode 100644 index 000000000..994190b23 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/48.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/49.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/49.bin new file mode 100644 index 000000000..5800900c2 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/49.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/5.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/5.bin new file mode 100644 index 000000000..bf997e6dd Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/5.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/50.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/50.bin new file mode 100644 index 000000000..91c168d59 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/50.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/51.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/51.bin new file mode 100644 index 000000000..3ad202a2d Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/51.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/52.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/52.bin new file mode 100644 index 000000000..2a7b2eee5 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/52.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/53.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/53.bin new file mode 100644 index 000000000..a7eb77f81 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/53.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/54.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/54.bin new file mode 100644 index 000000000..b5adc6ee9 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/54.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/55.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/55.bin new file mode 100644 index 000000000..e0c366242 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/55.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/56.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/56.bin new file mode 100644 index 000000000..86aeb7a89 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/56.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/57.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/57.bin new file mode 100644 index 000000000..001ef29e8 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/57.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/58.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/58.bin new file mode 100644 index 000000000..7d337919d Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/58.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/59.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/59.bin new file mode 100644 index 000000000..5d7aa11e3 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/59.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/6.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/6.bin new file mode 100644 index 000000000..bbb328f43 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/6.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/60.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/60.bin new file mode 100644 index 000000000..c20126709 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/60.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/61.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/61.bin new file mode 100644 index 000000000..db9d813d7 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/61.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/7.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/7.bin new file mode 100644 index 000000000..0d6bf0cdf Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/7.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/8.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/8.bin new file mode 100644 index 000000000..671457d68 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/8.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/9.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/9.bin new file mode 100644 index 000000000..0ce2a7a83 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/listen/9.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/1.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/1.bin new file mode 100644 index 000000000..ea8652699 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/1.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/10.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/10.bin new file mode 100644 index 000000000..b5f332945 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/10.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/11.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/11.bin new file mode 100644 index 000000000..e8e1cff8f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/11.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/12.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/12.bin new file mode 100644 index 000000000..66ea8a970 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/12.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/13.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/13.bin new file mode 100644 index 000000000..9575c1031 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/13.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/14.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/14.bin new file mode 100644 index 000000000..782105377 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/14.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/15.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/15.bin new file mode 100644 index 000000000..bc8a76423 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/15.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/16.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/16.bin new file mode 100644 index 000000000..6b845903c Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/16.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/17.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/17.bin new file mode 100644 index 000000000..03f60ffd8 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/17.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/18.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/18.bin new file mode 100644 index 000000000..c5ea57aae Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/18.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/19.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/19.bin new file mode 100644 index 000000000..dc45ebf8d Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/19.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/2.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/2.bin new file mode 100644 index 000000000..b06c0e442 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/2.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/20.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/20.bin new file mode 100644 index 000000000..9ea6c2fbd Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/20.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/21.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/21.bin new file mode 100644 index 000000000..fd1c90877 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/21.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/22.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/22.bin new file mode 100644 index 000000000..a85b6dff3 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/22.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/23.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/23.bin new file mode 100644 index 000000000..46e1786a9 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/23.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/24.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/24.bin new file mode 100644 index 000000000..0e562493f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/24.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/25.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/25.bin new file mode 100644 index 000000000..ec0fb78c4 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/25.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/26.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/26.bin new file mode 100644 index 000000000..58855ef61 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/26.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/27.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/27.bin new file mode 100644 index 000000000..b98c3e789 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/27.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/28.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/28.bin new file mode 100644 index 000000000..d6cdbdcaa Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/28.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/29.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/29.bin new file mode 100644 index 000000000..e69226a62 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/29.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/3.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/3.bin new file mode 100644 index 000000000..885aa7819 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/3.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/30.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/30.bin new file mode 100644 index 000000000..9ec2668fd Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/30.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/31.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/31.bin new file mode 100644 index 000000000..5861e2a03 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/31.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/32.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/32.bin new file mode 100644 index 000000000..14828bdbb Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/32.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/33.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/33.bin new file mode 100644 index 000000000..516378121 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/33.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/34.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/34.bin new file mode 100644 index 000000000..1b307be7f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/34.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/35.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/35.bin new file mode 100644 index 000000000..fc4a42ef9 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/35.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/36.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/36.bin new file mode 100644 index 000000000..003b38176 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/36.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/37.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/37.bin new file mode 100644 index 000000000..ae465e839 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/37.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/38.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/38.bin new file mode 100644 index 000000000..6a499ed66 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/38.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/39.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/39.bin new file mode 100644 index 000000000..ba30686ca Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/39.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/4.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/4.bin new file mode 100644 index 000000000..b4f2604f2 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/4.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/40.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/40.bin new file mode 100644 index 000000000..65554d579 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/40.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/41.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/41.bin new file mode 100644 index 000000000..8102a2770 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/41.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/42.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/42.bin new file mode 100644 index 000000000..34de5248c Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/42.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/43.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/43.bin new file mode 100644 index 000000000..7c4e5c0ae Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/43.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/44.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/44.bin new file mode 100644 index 000000000..281aa9576 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/44.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/45.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/45.bin new file mode 100644 index 000000000..0e48cc094 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/45.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/46.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/46.bin new file mode 100644 index 000000000..7a74a8a16 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/46.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/47.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/47.bin new file mode 100644 index 000000000..c19700487 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/47.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/48.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/48.bin new file mode 100644 index 000000000..2555bfb1a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/48.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/49.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/49.bin new file mode 100644 index 000000000..1f6901b01 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/49.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/5.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/5.bin new file mode 100644 index 000000000..c1e82f4d2 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/5.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/50.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/50.bin new file mode 100644 index 000000000..7c81d769e Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/50.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/51.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/51.bin new file mode 100644 index 000000000..8dbb48a9b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/51.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/52.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/52.bin new file mode 100644 index 000000000..a9e389cc9 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/52.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/53.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/53.bin new file mode 100644 index 000000000..81550431b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/53.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/54.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/54.bin new file mode 100644 index 000000000..e43ad7569 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/54.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/55.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/55.bin new file mode 100644 index 000000000..483e6f09b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/55.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/56.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/56.bin new file mode 100644 index 000000000..e370eae36 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/56.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/57.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/57.bin new file mode 100644 index 000000000..f91c4d2c0 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/57.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/58.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/58.bin new file mode 100644 index 000000000..dd39b5bf0 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/58.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/59.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/59.bin new file mode 100644 index 000000000..1c9ab6fa7 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/59.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/6.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/6.bin new file mode 100644 index 000000000..1a4556b81 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/6.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/60.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/60.bin new file mode 100644 index 000000000..668f41fd6 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/60.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/7.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/7.bin new file mode 100644 index 000000000..7b638d0a5 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/7.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/8.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/8.bin new file mode 100644 index 000000000..6f6afbb72 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/8.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/net/9.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/9.bin new file mode 100644 index 000000000..392dca685 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/net/9.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/1.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/1.bin new file mode 100644 index 000000000..a2786ef56 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/1.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/10.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/10.bin new file mode 100644 index 000000000..a2e0bb7ec Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/10.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/11.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/11.bin new file mode 100644 index 000000000..f4ed681de Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/11.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/12.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/12.bin new file mode 100644 index 000000000..10ce37890 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/12.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/13.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/13.bin new file mode 100644 index 000000000..16d79a8ed Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/13.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/14.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/14.bin new file mode 100644 index 000000000..3fa97bb91 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/14.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/15.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/15.bin new file mode 100644 index 000000000..b0199fb97 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/15.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/16.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/16.bin new file mode 100644 index 000000000..95286f798 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/16.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/17.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/17.bin new file mode 100644 index 000000000..3e77583ae Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/17.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/18.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/18.bin new file mode 100644 index 000000000..0338a07e0 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/18.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/19.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/19.bin new file mode 100644 index 000000000..529a65410 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/19.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/2.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/2.bin new file mode 100644 index 000000000..203cdebf7 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/2.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/20.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/20.bin new file mode 100644 index 000000000..d9188513a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/20.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/21.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/21.bin new file mode 100644 index 000000000..748de4cf7 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/21.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/22.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/22.bin new file mode 100644 index 000000000..610fd8f7e Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/22.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/23.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/23.bin new file mode 100644 index 000000000..d9466d9fb Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/23.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/24.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/24.bin new file mode 100644 index 000000000..b026cce4f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/24.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/25.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/25.bin new file mode 100644 index 000000000..9811d6f2c Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/25.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/3.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/3.bin new file mode 100644 index 000000000..6d4da3e5f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/3.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/4.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/4.bin new file mode 100644 index 000000000..af86f08b9 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/4.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/5.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/5.bin new file mode 100644 index 000000000..d7fada711 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/5.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/6.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/6.bin new file mode 100644 index 000000000..0025032df Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/6.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/7.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/7.bin new file mode 100644 index 000000000..a44111579 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/7.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/8.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/8.bin new file mode 100644 index 000000000..1cda2717e Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/8.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/9.bin b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/9.bin new file mode 100644 index 000000000..d9aed6ebd Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/animated_icon/speak/9.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Bangs/black.bin b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/black.bin new file mode 100644 index 000000000..5431e6d01 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/black.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Bangs/blue.bin b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/blue.bin new file mode 100644 index 000000000..a033011a0 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/blue.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Bangs/dark_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/dark_brown.bin new file mode 100644 index 000000000..926a345c4 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/dark_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Bangs/gold.bin b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/gold.bin new file mode 100644 index 000000000..b95733f0a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/gold.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Bangs/gray.bin b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/gray.bin new file mode 100644 index 000000000..245b53d0b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/gray.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Bangs/light_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/light_brown.bin new file mode 100644 index 000000000..a04b6632b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/light_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Bangs/purple.bin b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/purple.bin new file mode 100644 index 000000000..7fe1fb932 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/purple.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Bangs/white.bin b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/white.bin new file mode 100644 index 000000000..e83e5b556 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Bangs/white.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/black.bin b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/black.bin new file mode 100644 index 000000000..4b8701917 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/black.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/blue.bin b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/blue.bin new file mode 100644 index 000000000..2e3bff3ff Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/blue.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/dark_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/dark_brown.bin new file mode 100644 index 000000000..7b2462d3d Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/dark_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/gold.bin b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/gold.bin new file mode 100644 index 000000000..e3c04463e Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/gold.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/gray.bin b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/gray.bin new file mode 100644 index 000000000..74da45782 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/gray.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/light_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/light_brown.bin new file mode 100644 index 000000000..2e0dab58a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/light_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/purple.bin b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/purple.bin new file mode 100644 index 000000000..ea91abc8b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/purple.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/white.bin b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/white.bin new file mode 100644 index 000000000..478fe6669 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/CenterParting/white.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Classic/black.bin b/code/sdk/files/leiniao/fs/user/res/hair/Classic/black.bin new file mode 100644 index 000000000..59deb2f1c Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Classic/black.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Classic/blue.bin b/code/sdk/files/leiniao/fs/user/res/hair/Classic/blue.bin new file mode 100644 index 000000000..0c7294f0a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Classic/blue.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Classic/dark_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/Classic/dark_brown.bin new file mode 100644 index 000000000..82a1d1cef Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Classic/dark_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Classic/gold.bin b/code/sdk/files/leiniao/fs/user/res/hair/Classic/gold.bin new file mode 100644 index 000000000..108595ce5 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Classic/gold.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Classic/gray.bin b/code/sdk/files/leiniao/fs/user/res/hair/Classic/gray.bin new file mode 100644 index 000000000..8d349ac1b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Classic/gray.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Classic/light_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/Classic/light_brown.bin new file mode 100644 index 000000000..d370ae7c8 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Classic/light_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Classic/purple.bin b/code/sdk/files/leiniao/fs/user/res/hair/Classic/purple.bin new file mode 100644 index 000000000..ebb7b917b Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Classic/purple.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Classic/white.bin b/code/sdk/files/leiniao/fs/user/res/hair/Classic/white.bin new file mode 100644 index 000000000..37e7444e5 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Classic/white.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Angry.bin b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Angry.bin new file mode 100644 index 000000000..a212f874f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Angry.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Confused.bin b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Confused.bin new file mode 100644 index 000000000..2d3060286 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Confused.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Shocked.bin b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Shocked.bin new file mode 100644 index 000000000..082e0f645 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Shocked.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Sleeping.bin b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Sleeping.bin new file mode 100644 index 000000000..b04555ee9 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Sleeping.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Speechless.bin b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Speechless.bin new file mode 100644 index 000000000..2cbab89d4 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/HairIcon/Speechless.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/black.bin b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/black.bin new file mode 100644 index 000000000..65cee9827 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/black.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/blue.bin b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/blue.bin new file mode 100644 index 000000000..131652836 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/blue.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/dark_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/dark_brown.bin new file mode 100644 index 000000000..71e739053 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/dark_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/gold.bin b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/gold.bin new file mode 100644 index 000000000..702a28aeb Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/gold.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/gray.bin b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/gray.bin new file mode 100644 index 000000000..b812b3ac5 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/gray.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/light_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/light_brown.bin new file mode 100644 index 000000000..275aeb397 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/light_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/purple.bin b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/purple.bin new file mode 100644 index 000000000..895e2be87 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/purple.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/white.bin b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/white.bin new file mode 100644 index 000000000..d150a2770 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/Side-SweptBangs/white.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/dark_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/dark_brown.bin new file mode 100644 index 000000000..37d671178 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/dark_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/gold.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/gold.bin new file mode 100644 index 000000000..b925ec757 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/gold.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/gray.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/gray.bin new file mode 100644 index 000000000..21d9da88f Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/gray.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/light_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/light_brown.bin new file mode 100644 index 000000000..e1833e658 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/light_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/white.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/white.bin new file mode 100644 index 000000000..24e9aef8a Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingLong/white.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/black.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/black.bin new file mode 100644 index 000000000..f9515e6ca Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/black.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/blue.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/blue.bin new file mode 100644 index 000000000..8a8a2c05d Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/blue.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/dark_brown.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/dark_brown.bin new file mode 100644 index 000000000..512d3cda6 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/dark_brown.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/purple.bin b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/purple.bin new file mode 100644 index 000000000..dae59a8f1 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/hair/SidePartingShort/purple.bin differ diff --git a/code/sdk/files/leiniao/fs/user/res/yellowbg.bin b/code/sdk/files/leiniao/fs/user/res/yellowbg.bin new file mode 100644 index 000000000..4dd5a9bb4 Binary files /dev/null and b/code/sdk/files/leiniao/fs/user/res/yellowbg.bin differ diff --git a/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp b/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp index 5be3b2125..870de90c5 100644 --- a/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp +++ b/code/sdk/middleware/services/gui/uikit/proprietary/src/service/src/graphic_service_wrapper.cpp @@ -33,55 +33,59 @@ #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -static const uint32_t SECOND_TO_MILLISECOND = 1000; -static const int32_t FULL_FREQUENCE = 60; + static const uint32_t SECOND_TO_MILLISECOND = 1000; + static const int32_t FULL_FREQUENCE = 60; #if !defined(_WIN32) -static rtc_handle_t g_rtcHandle = nullptr; + static rtc_handle_t g_rtcHandle = nullptr; #endif -static int32_t g_timeInterval = -1; -static int32_t g_freq = 0; -static bool g_initialized = false; -bool g_isScreenOn = false; -static bool g_showLogo = false; -static OHOS::UIImageView* g_logo = nullptr; -static OHOS::ImageInfo* g_imgInfo = nullptr; - -static bool g_showOtaLogo = false; -static OHOS::UIImageView* g_ota_logo = nullptr; -static OHOS::ImageInfo* g_ota_imgInfo = nullptr; - -static uint32_t *g_boot_animation_task_handle = NULL; - -static OHOS::UIViewGroup* group=nullptr; -static OHOS::UIViewGroup* boot_group=nullptr; -static OHOS::UIImageAnimatorView* ReBootImageAnimatorView=nullptr; + static int32_t g_timeInterval = -1; + static int32_t g_freq = 0; + static bool g_initialized = false; + bool g_isScreenOn = false; + static bool g_showLogo = false; + static OHOS::UIImageView *g_logo = nullptr; + static OHOS::ImageInfo *g_imgInfo = nullptr; + + static bool g_showOtaLogo = false; + static OHOS::UIImageView *g_ota_logo = nullptr; + static OHOS::ImageInfo *g_ota_imgInfo = nullptr; + + static uint32_t *g_boot_animation_task_handle = NULL; + + static OHOS::UIViewGroup *group = nullptr; + static OHOS::UIViewGroup *boot_group = nullptr; + static OHOS::UIImageAnimatorView *ReBootImageAnimatorView = nullptr; #ifdef CUSTOM_Z1 -static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; //开机图片路径 -static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 30; // 图片帧数 + static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; // 开机图片路径 + static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 30; // 图片帧数 #elif defined(BOARD_W9) || defined(BOARD_N9) -static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; //开机图片路径 -static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 30; // 图片帧数 +static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; // 开机图片路径 +static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 30; // 图片帧数 +#elif defined(BOARD_LEINIAO) +static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; // 开机图片路径 +static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 57; // 图片帧数 #else -static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; //开机图片路径 -static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 36; // 图片帧数 +static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; // 开机图片路径 +static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 36; // 图片帧数 #endif -static constexpr int16_t REBOOT_IMAGE_ANIMATOR_TIME = 150; // 图片更新间隔 -static OHOS::ImageAnimatorInfo ReBootImageInfo[REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES]; // 开机图像的信息 -static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_X = 0; -static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_Y = 0; -static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_W = 466; -static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_H = 466; -const OHOS::ImageInfo **ReBootPathsArray{nullptr}; // 开机图片路径数组 -static OHOS::UIImageAnimatorView::AnimatorStopListener *bootStoplistener{nullptr}; -static bool boot_animation_flag = false; -static app_task_definition_t taskcfg={0}; + static constexpr int16_t REBOOT_IMAGE_ANIMATOR_TIME = 150; // 图片更新间隔 + static OHOS::ImageAnimatorInfo ReBootImageInfo[REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES]; // 开机图像的信息 + static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_X = 0; + static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_Y = 0; + static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_W = 466; + static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_H = 466; + const OHOS::ImageInfo **ReBootPathsArray{nullptr}; // 开机图片路径数组 + static OHOS::UIImageAnimatorView::AnimatorStopListener *bootStoplistener{nullptr}; + static bool boot_animation_flag = false; + static app_task_definition_t taskcfg = {0}; #ifdef QSPI_DISPLAY #define IMAGE_OPEN_LOGO_PATH "/user/res/OPEN_LOGO_QSPI.bin" #else -#ifdef SINGLE_USER_PARTITION +#ifdef SINGLE_USER_PARTITION #define IMAGE_OPEN_LOGO_PATH "/user/system/KUMI_LOGO.bin" #define IMAGE_OTA_LOGO_PATH "/user/system/OTAUpdata.bin" #else @@ -94,7 +98,7 @@ static app_task_definition_t taskcfg={0}; #ifdef IMAGE_OPEN_LOGO_PATH #undef IMAGE_OPEN_LOGO_PATH #endif -#ifdef SINGLE_USER_PARTITION +#ifdef SINGLE_USER_PARTITION #define IMAGE_OPEN_LOGO_PATH "/user/system/z1bootlogo.bin" #else #define IMAGE_OPEN_LOGO_PATH "/system/z1bootlogo.bin" @@ -105,117 +109,114 @@ static app_task_definition_t taskcfg={0}; #ifdef IMAGE_OPEN_LOGO_PATH #undef IMAGE_OPEN_LOGO_PATH #endif -#ifdef SINGLE_USER_PARTITION +#ifdef SINGLE_USER_PARTITION #define IMAGE_OPEN_LOGO_PATH "/user/system/N9_TEST_LOGO.bin" #else #define IMAGE_OPEN_LOGO_PATH "/system/N9_TEST_LOGO.bin" #endif #endif - -static void FreeImagePathsArray(const char **imagePaths, const int numImages) -{ - for (int i = 0; i < numImages; i++) + static void FreeImagePathsArray(const char **imagePaths, const int numImages) { - delete imagePaths[i]; - imagePaths[i] = nullptr; + for (int i = 0; i < numImages; i++) + { + delete imagePaths[i]; + imagePaths[i] = nullptr; + } } -} -static void ClearAll(void) -{ - if(group!=nullptr) + static void ClearAll(void) { - OHOS::RootView::GetInstance()->Remove(group); - group->RemoveAll(); - - if (ReBootImageAnimatorView != nullptr) + if (group != nullptr) { - delete ReBootImageAnimatorView; - ReBootImageAnimatorView = nullptr; - } + OHOS::RootView::GetInstance()->Remove(group); + group->RemoveAll(); - if(bootStoplistener!=nullptr) - { - delete bootStoplistener; - bootStoplistener = nullptr; - } + if (ReBootImageAnimatorView != nullptr) + { + delete ReBootImageAnimatorView; + ReBootImageAnimatorView = nullptr; + } - // FreeImagePathsArray(ReBootPathsArray, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); - #ifdef SUPPORT_CUSTOM_UI_COMPONENT - OHOS::FreeImageInfoArray(ReBootPathsArray, ReBootPaths, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); - #endif + if (bootStoplistener != nullptr) + { + delete bootStoplistener; + bootStoplistener = nullptr; + } - delete group; - group = nullptr; - } -} +// FreeImagePathsArray(ReBootPathsArray, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); +#ifdef SUPPORT_CUSTOM_UI_COMPONENT + OHOS::FreeImageInfoArray(ReBootPathsArray, ReBootPaths, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); +#endif -class BootAnimatorListener:public OHOS::UIImageAnimatorView::AnimatorStopListener -{ -public: -BootAnimatorListener(){} -~BootAnimatorListener(){} + delete group; + group = nullptr; + } + } -private: - void OnAnimatorStop(OHOS::UIView &view) + class BootAnimatorListener : public OHOS::UIImageAnimatorView::AnimatorStopListener { - boot_animation_flag = true; - - ClearAll(); - - //boot_group->SetVisible(false); - OHOS::RootView::GetInstance()->Remove(boot_group); - delete boot_group; - boot_group = nullptr; - } + public: + BootAnimatorListener() {} + ~BootAnimatorListener() {} + + private: + void OnAnimatorStop(OHOS::UIView &view) + { + boot_animation_flag = true; -}; + ClearAll(); + // boot_group->SetVisible(false); + OHOS::RootView::GetInstance()->Remove(boot_group); + delete boot_group; + boot_group = nullptr; + } + }; -static const char ** CreateImagePathsArray(const char *basePath, const char *fileExtension, int numImages) -{ - const char **imagePaths = new const char *[numImages]; - char buffer[256]; - for (int i = 0; i < numImages; i++) + static const char **CreateImagePathsArray(const char *basePath, const char *fileExtension, int numImages) { + const char **imagePaths = new const char *[numImages]; + char buffer[256]; + for (int i = 0; i < numImages; i++) + { #ifdef CUSTOM_Z1 - snprintf(buffer, sizeof(buffer), "%s%d.%s", basePath, numImages - i , fileExtension); + snprintf(buffer, sizeof(buffer), "%s%d.%s", basePath, numImages - i, fileExtension); #else - snprintf(buffer, sizeof(buffer), "%s%d.%s", basePath, i + 1 , fileExtension); + snprintf(buffer, sizeof(buffer), "%s%d.%s", basePath, i + 1, fileExtension); #endif - imagePaths[i] = strdup(buffer); + imagePaths[i] = strdup(buffer); + } + return imagePaths; } - return imagePaths; -} -bool ShowReBootAnimatorView() -{ - #ifdef SUPPORT_CUSTOM_UI_COMPONENT - ReBootPathsArray = OHOS::CreateImageInfoArray(ReBootPaths, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); - #endif - - if (ReBootImageAnimatorView == nullptr) + bool ShowReBootAnimatorView() { - ReBootImageAnimatorView = new OHOS::UIImageAnimatorView(); +#ifdef SUPPORT_CUSTOM_UI_COMPONENT + ReBootPathsArray = OHOS::CreateImageInfoArray(ReBootPaths, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); +#endif + if (ReBootImageAnimatorView == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "new ReBootImageAnimatorView fail"); - return false; - } + ReBootImageAnimatorView = new OHOS::UIImageAnimatorView(); + if (ReBootImageAnimatorView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "new ReBootImageAnimatorView fail"); + return false; + } #if defined(BOARD_W9) || defined(BOARD_N9) - for (int j = 0, i = REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES - 1; - i > 0 && j < REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; - i--, j++) - { - ReBootImageInfo[j].imageInfo = ReBootPathsArray[i]; - ReBootImageInfo[j].imageType = OHOS::IMG_SRC_IMAGE_INFO; - ReBootImageInfo[j].pos.x = REBOOT_IMAGE_ANIMATOR_VIEW_X; - ReBootImageInfo[j].pos.y = REBOOT_IMAGE_ANIMATOR_VIEW_Y; - ReBootImageInfo[j].width = REBOOT_IMAGE_ANIMATOR_VIEW_W; - ReBootImageInfo[j].height = REBOOT_IMAGE_ANIMATOR_VIEW_H; - } + for (int j = 0, i = REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES - 1; + i > 0 && j < REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; + i--, j++) + { + ReBootImageInfo[j].imageInfo = ReBootPathsArray[i]; + ReBootImageInfo[j].imageType = OHOS::IMG_SRC_IMAGE_INFO; + ReBootImageInfo[j].pos.x = REBOOT_IMAGE_ANIMATOR_VIEW_X; + ReBootImageInfo[j].pos.y = REBOOT_IMAGE_ANIMATOR_VIEW_Y; + ReBootImageInfo[j].width = REBOOT_IMAGE_ANIMATOR_VIEW_W; + ReBootImageInfo[j].height = REBOOT_IMAGE_ANIMATOR_VIEW_H; + } #else for (uint8_t i = 0; i < REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++) { @@ -227,307 +228,335 @@ bool ShowReBootAnimatorView() ReBootImageInfo[i].height = REBOOT_IMAGE_ANIMATOR_VIEW_H; } #endif - ReBootImageAnimatorView->SetPosition(REBOOT_IMAGE_ANIMATOR_VIEW_X, REBOOT_IMAGE_ANIMATOR_VIEW_Y, REBOOT_IMAGE_ANIMATOR_VIEW_W, REBOOT_IMAGE_ANIMATOR_VIEW_H); - ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, 0xffffffff); - ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_OPA, 0xff); - ReBootImageAnimatorView->SetImageAnimatorSrc(ReBootImageInfo, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES, 100); - ReBootImageAnimatorView->SetRepeat(false); - ReBootImageAnimatorView->SetRepeatTimes(1); - - bootStoplistener = static_cast(new BootAnimatorListener()); - if (bootStoplistener == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to Create bootStoplistener!!"); - return false; +#if defined(BOARD_LEINIAO) + ReBootImageAnimatorView->SetAutoEnable(false); +#endif + ReBootImageAnimatorView->SetPosition(REBOOT_IMAGE_ANIMATOR_VIEW_X, REBOOT_IMAGE_ANIMATOR_VIEW_Y, REBOOT_IMAGE_ANIMATOR_VIEW_W, REBOOT_IMAGE_ANIMATOR_VIEW_H); + ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, 0xffffffff); + ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_OPA, 0xff); + ReBootImageAnimatorView->SetImageAnimatorSrc(ReBootImageInfo, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES, 100); +#if defined(BOARD_LEINIAO) + ReBootImageAnimatorView->SetResizeMode(OHOS::UIImageView::COVER); +#endif + ReBootImageAnimatorView->SetRepeat(false); + ReBootImageAnimatorView->SetRepeatTimes(1); + + bootStoplistener = static_cast(new BootAnimatorListener()); + if (bootStoplistener == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to Create bootStoplistener!!"); + return false; + } + ReBootImageAnimatorView->SetAnimatorStopListener(bootStoplistener); } - ReBootImageAnimatorView->SetAnimatorStopListener(bootStoplistener); - } - - return true; -} - -OHOS::UIViewGroup* ReBootAnimatorViewInit(void) -{ - bool ret; - group = new OHOS::UIViewGroup(); - if (group == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP," group new fail"); - return nullptr; + return true; } - group->SetPosition(0, 0, OHOS::HORIZONTAL_RESOLUTION, OHOS::VERTICAL_RESOLUTION); - group->SetStyle(OHOS::STYLE_BACKGROUND_OPA, OHOS::OPA_OPAQUE); - ret = ShowReBootAnimatorView(); - if (ret == false) + OHOS::UIViewGroup *ReBootAnimatorViewInit(void) { - return nullptr; - } + bool ret; + group = new OHOS::UIViewGroup(); + if (group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " group new fail"); + return nullptr; + } + group->SetPosition(0, 0, OHOS::HORIZONTAL_RESOLUTION, OHOS::VERTICAL_RESOLUTION); + group->SetStyle(OHOS::STYLE_BACKGROUND_OPA, OHOS::OPA_OPAQUE); + ret = ShowReBootAnimatorView(); - group->Add(ReBootImageAnimatorView); - return group; -} + if (ret == false) + { + return nullptr; + } -static void UikitRTCCallBack(uintptr_t data) -{ - (void)(data); - if (!g_initialized || !g_isScreenOn) { - GRAPHIC_LOGE("RTC should not be started when g_isScreenOn:%d g_initialized:%d", g_isScreenOn, g_initialized); - return; + group->Add(ReBootImageAnimatorView); + return group; } + + static void UikitRTCCallBack(uintptr_t data) + { + (void)(data); + if (!g_initialized || !g_isScreenOn) + { + GRAPHIC_LOGE("RTC should not be started when g_isScreenOn:%d g_initialized:%d", g_isScreenOn, g_initialized); + return; + } #if !defined(_WIN32) - uapi_rtc_start(g_rtcHandle, g_timeInterval, UikitRTCCallBack, 0); + uapi_rtc_start(g_rtcHandle, g_timeInterval, UikitRTCCallBack, 0); #endif - GraphicService::GetInstance()->UpdateGraphicEvent(); -} - -void SetFrequenceInner(int freq) -{ - if (!g_isScreenOn) { - return; + GraphicService::GetInstance()->UpdateGraphicEvent(); } - if (freq > FULL_FREQUENCE) { - freq = FULL_FREQUENCE; - } + void SetFrequenceInner(int freq) + { + if (!g_isScreenOn) + { + return; + } - if ((g_freq != freq) && (freq != 0)) { - g_freq = freq; - g_timeInterval = SECOND_TO_MILLISECOND / freq; - GRAPHIC_LOGI("set freq: %d, time: %dms\n", freq, g_timeInterval); - if (freq == FULL_FREQUENCE) { - if (!OHOS::LowPowerManager::GetInstance()->IsLiteSurfaceInRootView()) { - GraphicService::GetInstance()->EnableAsyncMode(true); - } - } else { - GraphicService::GetInstance()->EnableAsyncMode(false); + if (freq > FULL_FREQUENCE) + { + freq = FULL_FREQUENCE; } + + if ((g_freq != freq) && (freq != 0)) + { + g_freq = freq; + g_timeInterval = SECOND_TO_MILLISECOND / freq; + GRAPHIC_LOGI("set freq: %d, time: %dms\n", freq, g_timeInterval); + if (freq == FULL_FREQUENCE) + { + if (!OHOS::LowPowerManager::GetInstance()->IsLiteSurfaceInRootView()) + { + GraphicService::GetInstance()->EnableAsyncMode(true); + } + } + else + { + GraphicService::GetInstance()->EnableAsyncMode(false); + } #if !defined(_WIN32) - uapi_rtc_start(g_rtcHandle, g_timeInterval, UikitRTCCallBack, 0); + uapi_rtc_start(g_rtcHandle, g_timeInterval, UikitRTCCallBack, 0); #endif + } } -} -int GetFrequence(void) -{ - return g_freq; -} + int GetFrequence(void) + { + return g_freq; + } -int IsNativeRunning(void) -{ - return GraphicService::GetInstance()->IsNativeRunning(); -} + int IsNativeRunning(void) + { + return GraphicService::GetInstance()->IsNativeRunning(); + } -void SetFrequence(int freq) -{ - GraphicService::GetInstance()->PostGraphicEvent([=] { - SetFrequenceInner(freq); - }); -} + void SetFrequence(int freq) + { + GraphicService::GetInstance()->PostGraphicEvent([=] + { SetFrequenceInner(freq); }); + } -void NotifyScreenOn(void) -{ - GraphicService::GetInstance()->NotifyScreenOn(); + void NotifyScreenOn(void) + { + GraphicService::GetInstance()->NotifyScreenOn(); #if !defined(_WIN32) - if (g_rtcHandle == nullptr) { - return; - } + if (g_rtcHandle == nullptr) + { + return; + } #endif - if (!g_isScreenOn) { - g_isScreenOn = true; - OHOS::LowPowerManager::GetInstance()->ExitLowPower(); + if (!g_isScreenOn) + { + g_isScreenOn = true; + OHOS::LowPowerManager::GetInstance()->ExitLowPower(); + } } -} -void NotifyScreenOff(void) -{ + void NotifyScreenOff(void) + { #if !defined(_WIN32) - if (g_rtcHandle != nullptr) { - uapi_rtc_stop(g_rtcHandle); - g_freq = 0; - g_timeInterval = -1; - } + if (g_rtcHandle != nullptr) + { + uapi_rtc_stop(g_rtcHandle); + g_freq = 0; + g_timeInterval = -1; + } #endif - g_isScreenOn = false; - GraphicService::GetInstance()->NotifyScreenOff(); -} - -void InitGraphicService(void) -{ - if (g_initialized) { - return; + g_isScreenOn = false; + GraphicService::GetInstance()->NotifyScreenOff(); } + void InitGraphicService(void) + { + if (g_initialized) + { + return; + } + #if !defined(_WIN32) - /* create RTC timer */ - uapi_rtc_create(RTC_0, &g_rtcHandle); - if (g_rtcHandle == nullptr) { - GRAPHIC_LOGE("create RTC timer fail!!"); - return; - } + /* create RTC timer */ + uapi_rtc_create(RTC_0, &g_rtcHandle); + if (g_rtcHandle == nullptr) + { + GRAPHIC_LOGE("create RTC timer fail!!"); + return; + } #endif - if (!GraphicService::GetInstance()->InitGraphicService()) { - GRAPHIC_LOGE("InitGraphicService fail!!"); + if (!GraphicService::GetInstance()->InitGraphicService()) + { + GRAPHIC_LOGE("InitGraphicService fail!!"); #if !defined(_WIN32) - uapi_rtc_stop(g_rtcHandle); - uapi_rtc_delete(g_rtcHandle); + uapi_rtc_stop(g_rtcHandle); + uapi_rtc_delete(g_rtcHandle); #endif - return; + return; + } + g_initialized = true; } - g_initialized = true; -} -void HideGraphicLogo() -{ - if (!g_showLogo) { + void HideGraphicLogo() + { + if (!g_showLogo) + { return; } - g_showLogo = false; - GraphicService::GetInstance()->PostGraphicEvent( - [] { - if (g_logo != nullptr) { + g_showLogo = false; + GraphicService::GetInstance()->PostGraphicEvent( + [] + { + if (g_logo != nullptr) + { OHOS::RootView::GetInstance()->Remove(g_logo); delete g_logo; g_logo = nullptr; OHOS::ImageCacheManager::GetInstance().UnloadSingleRes(IMAGE_OPEN_LOGO_PATH); g_imgInfo = nullptr; } - }); -} - -void HideGraphicOtaLogo() -{ - if (!g_showOtaLogo) { - return; + }); } - g_showOtaLogo = false; - GraphicService::GetInstance()->PostGraphicEvent( - [] { - if (g_ota_logo != nullptr) { - OHOS::RootView::GetInstance()->Remove(g_ota_logo); - delete g_ota_logo; - g_ota_logo = nullptr; - OHOS::ImageCacheManager::GetInstance().UnloadSingleRes(IMAGE_OTA_LOGO_PATH); - g_ota_imgInfo = nullptr; - } - }); -} - -static void boot_animation_task(void *arg) -{ - unused(arg); - boot_group = ReBootAnimatorViewInit(); - if (boot_group == nullptr) + void HideGraphicOtaLogo() { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP," boot_group nullptr fail"); - return; + if (!g_showOtaLogo) + { + return; + } + g_showOtaLogo = false; + GraphicService::GetInstance()->PostGraphicEvent( + [] + { + if (g_ota_logo != nullptr) + { + OHOS::RootView::GetInstance()->Remove(g_ota_logo); + delete g_ota_logo; + g_ota_logo = nullptr; + OHOS::ImageCacheManager::GetInstance().UnloadSingleRes(IMAGE_OTA_LOGO_PATH); + g_ota_imgInfo = nullptr; + } + }); } - HideGraphicLogo(); - HideGraphicOtaLogo(); - OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent( - [] { - OHOS::RootView::GetInstance()->Add(boot_group); - ReBootImageAnimatorView->Start(); - }, - false); - -} - -void wait_animation_stop(void) -{ - while(boot_animation_flag == false) + + static void boot_animation_task(void *arg) { - LOS_Msleep(1000); + unused(arg); + + boot_group = ReBootAnimatorViewInit(); + if (boot_group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " boot_group nullptr fail"); + return; + } + HideGraphicLogo(); + HideGraphicOtaLogo(); + OHOS::GraphicEventHandler::GetInstance()->PostGraphicEvent( + [] + { + OHOS::RootView::GetInstance()->Add(boot_group); + ReBootImageAnimatorView->Start(); + }, + false); } -} -void ShowGraphicLogo(void) -{ - if (g_showLogo) { - return; + void wait_animation_stop(void) + { + while (boot_animation_flag == false) + { + LOS_Msleep(1000); + } } - g_showLogo = true; - g_logo = new OHOS::UIImageView(); - g_logo->SetPosition(0, 0, OHOS::Screen::GetInstance().GetWidth(), OHOS::Screen::GetInstance().GetHeight()); - g_logo->SetAutoEnable(false); - g_logo->SetResizeMode(OHOS::UIImageView::CENTER); - g_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(IMAGE_OPEN_LOGO_PATH); - g_logo->SetSrc(g_imgInfo); - GraphicService::GetInstance()->PostGraphicEvent( - [] { - OHOS::RootView::GetInstance()->Add(g_logo); - OHOS::RootView::GetInstance()->Invalidate(); - }); - LOS_Msleep(500); -} - -void ShowGraphicOTALogo(void) -{ - if (g_showOtaLogo) { - return; + void ShowGraphicLogo(void) + { + if (g_showLogo) + { + return; + } + g_showLogo = true; + g_logo = new OHOS::UIImageView(); + g_logo->SetPosition(0, 0, OHOS::Screen::GetInstance().GetWidth(), OHOS::Screen::GetInstance().GetHeight()); + g_logo->SetAutoEnable(false); + g_logo->SetResizeMode(OHOS::UIImageView::CENTER); + g_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(IMAGE_OPEN_LOGO_PATH); + g_logo->SetSrc(g_imgInfo); + GraphicService::GetInstance()->PostGraphicEvent( + [] + { + OHOS::RootView::GetInstance()->Add(g_logo); + OHOS::RootView::GetInstance()->Invalidate(); + }); + LOS_Msleep(500); } - g_showOtaLogo = true; - g_ota_logo = new OHOS::UIImageView(); - g_ota_logo->SetPosition(0, 0, OHOS::Screen::GetInstance().GetWidth(), OHOS::Screen::GetInstance().GetHeight()); - g_ota_logo->SetAutoEnable(false); - g_ota_logo->SetResizeMode(OHOS::UIImageView::CENTER); - g_ota_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(IMAGE_OTA_LOGO_PATH); - g_ota_logo->SetSrc(g_ota_imgInfo); - GraphicService::GetInstance()->PostGraphicEvent( - [] { - OHOS::RootView::GetInstance()->Add(g_ota_logo); - OHOS::RootView::GetInstance()->Invalidate(); - }); - LOS_Msleep(500); - -} - -void boot_animation_init_deinit(void) -{ - errcode_t ret = uapi_terminate_thread(taskcfg.task_handle); - if(ret != ERRCODE_SUCC) - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"kill boot_animation_task failed %d!",ret); - else - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"kill boot_animation_task succed !"); + void ShowGraphicOTALogo(void) + { + + if (g_showOtaLogo) + { + return; + } + g_showOtaLogo = true; + g_ota_logo = new OHOS::UIImageView(); + g_ota_logo->SetPosition(0, 0, OHOS::Screen::GetInstance().GetWidth(), OHOS::Screen::GetInstance().GetHeight()); + g_ota_logo->SetAutoEnable(false); + g_ota_logo->SetResizeMode(OHOS::UIImageView::CENTER); + g_ota_imgInfo = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(IMAGE_OTA_LOGO_PATH); + g_ota_logo->SetSrc(g_ota_imgInfo); + GraphicService::GetInstance()->PostGraphicEvent( + [] + { + OHOS::RootView::GetInstance()->Add(g_ota_logo); + OHOS::RootView::GetInstance()->Invalidate(); + }); + LOS_Msleep(500); + } - if(taskcfg.attr.stack_mem != NULL) + void boot_animation_init_deinit(void) { - free(taskcfg.attr.stack_mem); - taskcfg.attr.stack_mem = NULL; + errcode_t ret = uapi_terminate_thread(taskcfg.task_handle); + + if (ret != ERRCODE_SUCC) + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "kill boot_animation_task failed %d!", ret); + else + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "kill boot_animation_task succed !"); + + if (taskcfg.attr.stack_mem != NULL) + { + free(taskcfg.attr.stack_mem); + taskcfg.attr.stack_mem = NULL; + } + if (taskcfg.task_handle != NULL) + taskcfg.task_handle = NULL; } - if(taskcfg.task_handle != NULL) - taskcfg.task_handle = NULL; -} -void boot_animation_init(void) -{ - taskcfg.task_handle = g_boot_animation_task_handle; - taskcfg.attr.name="boot_animation_service"; - taskcfg.attr.priority = TASK_PRIORITY_APP; - taskcfg.attr.stack_size = 0x1000; - taskcfg.func = boot_animation_task; - taskcfg.use_mem = USE_EXTEND_MEM; - - errcode_t ret=uapi_create_osThread_custom(&taskcfg); - if(ret != ERRCODE_SUCC) + void boot_animation_init(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"create boot_animation_task failed %d!",ret); - return ; + taskcfg.task_handle = g_boot_animation_task_handle; + taskcfg.attr.name = "boot_animation_service"; + taskcfg.attr.priority = TASK_PRIORITY_APP; + taskcfg.attr.stack_size = 0x1000; + taskcfg.func = boot_animation_task; + taskcfg.use_mem = USE_EXTEND_MEM; + + errcode_t ret = uapi_create_osThread_custom(&taskcfg); + if (ret != ERRCODE_SUCC) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "create boot_animation_task failed %d!", ret); + return; + } } -} -void PostGraphicEvent(GraphicEventCb eventCb, void* userData) -{ - GraphicService::GetInstance()->PostGraphicEvent( - [=] { - eventCb(userData); + void PostGraphicEvent(GraphicEventCb eventCb, void *userData) + { + GraphicService::GetInstance()->PostGraphicEvent( + [=] + { + eventCb(userData); }); -} + } #ifdef __cplusplus }; #endif