From: xue <2144439972@qq.com> Date: Fri, 28 Nov 2025 08:15:17 +0000 (+0800) Subject: 优化蓝牙UI X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=205d244c49031768cf2a749b6839ec901e9b10b7;p=mirrors%2FFD230.git 优化蓝牙UI --- 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 c598e2f61..5c5496d41 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativelauncher/include/UiConfig.h @@ -460,6 +460,83 @@ namespace OHOS { 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 animations: search 1..30 + static constexpr const char *TB_SEARCH_IMAGE_1 = APP_RES_PATH"/animated_icon/sreach/1.bin"; + static constexpr const char *TB_SEARCH_IMAGE_2 = APP_RES_PATH"/animated_icon/sreach/2.bin"; + static constexpr const char *TB_SEARCH_IMAGE_3 = APP_RES_PATH"/animated_icon/sreach/3.bin"; + static constexpr const char *TB_SEARCH_IMAGE_4 = APP_RES_PATH"/animated_icon/sreach/4.bin"; + static constexpr const char *TB_SEARCH_IMAGE_5 = APP_RES_PATH"/animated_icon/sreach/5.bin"; + static constexpr const char *TB_SEARCH_IMAGE_6 = APP_RES_PATH"/animated_icon/sreach/6.bin"; + static constexpr const char *TB_SEARCH_IMAGE_7 = APP_RES_PATH"/animated_icon/sreach/7.bin"; + static constexpr const char *TB_SEARCH_IMAGE_8 = APP_RES_PATH"/animated_icon/sreach/8.bin"; + static constexpr const char *TB_SEARCH_IMAGE_9 = APP_RES_PATH"/animated_icon/sreach/9.bin"; + static constexpr const char *TB_SEARCH_IMAGE_10 = APP_RES_PATH"/animated_icon/sreach/10.bin"; + static constexpr const char *TB_SEARCH_IMAGE_11 = APP_RES_PATH"/animated_icon/sreach/11.bin"; + static constexpr const char *TB_SEARCH_IMAGE_12 = APP_RES_PATH"/animated_icon/sreach/12.bin"; + static constexpr const char *TB_SEARCH_IMAGE_13 = APP_RES_PATH"/animated_icon/sreach/13.bin"; + static constexpr const char *TB_SEARCH_IMAGE_14 = APP_RES_PATH"/animated_icon/sreach/14.bin"; + static constexpr const char *TB_SEARCH_IMAGE_15 = APP_RES_PATH"/animated_icon/sreach/15.bin"; + static constexpr const char *TB_SEARCH_IMAGE_16 = APP_RES_PATH"/animated_icon/sreach/16.bin"; + static constexpr const char *TB_SEARCH_IMAGE_17 = APP_RES_PATH"/animated_icon/sreach/17.bin"; + static constexpr const char *TB_SEARCH_IMAGE_18 = APP_RES_PATH"/animated_icon/sreach/18.bin"; + static constexpr const char *TB_SEARCH_IMAGE_19 = APP_RES_PATH"/animated_icon/sreach/19.bin"; + static constexpr const char *TB_SEARCH_IMAGE_20 = APP_RES_PATH"/animated_icon/sreach/20.bin"; + static constexpr const char *TB_SEARCH_IMAGE_21 = APP_RES_PATH"/animated_icon/sreach/21.bin"; + static constexpr const char *TB_SEARCH_IMAGE_22 = APP_RES_PATH"/animated_icon/sreach/22.bin"; + static constexpr const char *TB_SEARCH_IMAGE_23 = APP_RES_PATH"/animated_icon/sreach/23.bin"; + static constexpr const char *TB_SEARCH_IMAGE_24 = APP_RES_PATH"/animated_icon/sreach/24.bin"; + + // Thunderbird animations: list 1..49 + static constexpr const char *TB_LIST_IMAGE_1 = APP_RES_PATH"/animated_icon/list/1.bin"; + static constexpr const char *TB_LIST_IMAGE_2 = APP_RES_PATH"/animated_icon/list/2.bin"; + static constexpr const char *TB_LIST_IMAGE_3 = APP_RES_PATH"/animated_icon/list/3.bin"; + static constexpr const char *TB_LIST_IMAGE_4 = APP_RES_PATH"/animated_icon/list/4.bin"; + static constexpr const char *TB_LIST_IMAGE_5 = APP_RES_PATH"/animated_icon/list/5.bin"; + static constexpr const char *TB_LIST_IMAGE_6 = APP_RES_PATH"/animated_icon/list/6.bin"; + static constexpr const char *TB_LIST_IMAGE_7 = APP_RES_PATH"/animated_icon/list/7.bin"; + static constexpr const char *TB_LIST_IMAGE_8 = APP_RES_PATH"/animated_icon/list/8.bin"; + static constexpr const char *TB_LIST_IMAGE_9 = APP_RES_PATH"/animated_icon/list/9.bin"; + static constexpr const char *TB_LIST_IMAGE_10 = APP_RES_PATH"/animated_icon/list/10.bin"; + static constexpr const char *TB_LIST_IMAGE_11 = APP_RES_PATH"/animated_icon/list/11.bin"; + static constexpr const char *TB_LIST_IMAGE_12 = APP_RES_PATH"/animated_icon/list/12.bin"; + static constexpr const char *TB_LIST_IMAGE_13 = APP_RES_PATH"/animated_icon/list/13.bin"; + static constexpr const char *TB_LIST_IMAGE_14 = APP_RES_PATH"/animated_icon/list/14.bin"; + static constexpr const char *TB_LIST_IMAGE_15 = APP_RES_PATH"/animated_icon/list/15.bin"; + static constexpr const char *TB_LIST_IMAGE_16 = APP_RES_PATH"/animated_icon/list/16.bin"; + static constexpr const char *TB_LIST_IMAGE_17 = APP_RES_PATH"/animated_icon/list/17.bin"; + static constexpr const char *TB_LIST_IMAGE_18 = APP_RES_PATH"/animated_icon/list/18.bin"; + static constexpr const char *TB_LIST_IMAGE_19 = APP_RES_PATH"/animated_icon/list/19.bin"; + static constexpr const char *TB_LIST_IMAGE_20 = APP_RES_PATH"/animated_icon/list/20.bin"; + static constexpr const char *TB_LIST_IMAGE_21 = APP_RES_PATH"/animated_icon/list/21.bin"; + static constexpr const char *TB_LIST_IMAGE_22 = APP_RES_PATH"/animated_icon/list/22.bin"; + static constexpr const char *TB_LIST_IMAGE_23 = APP_RES_PATH"/animated_icon/list/23.bin"; + static constexpr const char *TB_LIST_IMAGE_24 = APP_RES_PATH"/animated_icon/list/24.bin"; + static constexpr const char *TB_LIST_IMAGE_25 = APP_RES_PATH"/animated_icon/list/25.bin"; + static constexpr const char *TB_LIST_IMAGE_26 = APP_RES_PATH"/animated_icon/list/26.bin"; + static constexpr const char *TB_LIST_IMAGE_27 = APP_RES_PATH"/animated_icon/list/27.bin"; + static constexpr const char *TB_LIST_IMAGE_28 = APP_RES_PATH"/animated_icon/list/28.bin"; + static constexpr const char *TB_LIST_IMAGE_29 = APP_RES_PATH"/animated_icon/list/29.bin"; + static constexpr const char *TB_LIST_IMAGE_30 = APP_RES_PATH"/animated_icon/list/30.bin"; + static constexpr const char *TB_LIST_IMAGE_31 = APP_RES_PATH"/animated_icon/list/31.bin"; + static constexpr const char *TB_LIST_IMAGE_32 = APP_RES_PATH"/animated_icon/list/32.bin"; + static constexpr const char *TB_LIST_IMAGE_33 = APP_RES_PATH"/animated_icon/list/33.bin"; + static constexpr const char *TB_LIST_IMAGE_34 = APP_RES_PATH"/animated_icon/list/34.bin"; + static constexpr const char *TB_LIST_IMAGE_35 = APP_RES_PATH"/animated_icon/list/35.bin"; + static constexpr const char *TB_LIST_IMAGE_36 = APP_RES_PATH"/animated_icon/list/36.bin"; + static constexpr const char *TB_LIST_IMAGE_37 = APP_RES_PATH"/animated_icon/list/37.bin"; + static constexpr const char *TB_LIST_IMAGE_38 = APP_RES_PATH"/animated_icon/list/38.bin"; + static constexpr const char *TB_LIST_IMAGE_39 = APP_RES_PATH"/animated_icon/list/39.bin"; + static constexpr const char *TB_LIST_IMAGE_40 = APP_RES_PATH"/animated_icon/list/40.bin"; + static constexpr const char *TB_LIST_IMAGE_41 = APP_RES_PATH"/animated_icon/list/41.bin"; + static constexpr const char *TB_LIST_IMAGE_42 = APP_RES_PATH"/animated_icon/list/42.bin"; + static constexpr const char *TB_LIST_IMAGE_43 = APP_RES_PATH"/animated_icon/list/43.bin"; + static constexpr const char *TB_LIST_IMAGE_44 = APP_RES_PATH"/animated_icon/list/44.bin"; + static constexpr const char *TB_LIST_IMAGE_45 = APP_RES_PATH"/animated_icon/list/45.bin"; + static constexpr const char *TB_LIST_IMAGE_46 = APP_RES_PATH"/animated_icon/list/46.bin"; + static constexpr const char *TB_LIST_IMAGE_47 = APP_RES_PATH"/animated_icon/list/47.bin"; + static constexpr const char *TB_LIST_IMAGE_48 = APP_RES_PATH"/animated_icon/list/48.bin"; + static constexpr const char *TB_LIST_IMAGE_49 = APP_RES_PATH"/animated_icon/list/49.bin"; // Thunderbird animations: net 1..60 static constexpr const char *TB_NET_IMAGE_1 = APP_RES_PATH"/animated_icon/net/1.bin"; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdBlueView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdBlueView.h index 30ee34a49..f9c5d2372 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdBlueView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdBlueView.h @@ -6,11 +6,108 @@ #include "components/ui_label_ext.h" #include "components/ui_label_ext_with_shadow.h" #include "components/ui_image_view.h" +#include "components/ui_image_animator.h" #include "components/ui_list.h" #include "UiConfig.h" namespace OHOS { + // 搜索动画配置 + static constexpr int16_t TB_BLUE_SEARCH_ANIM_X = 148; + static constexpr int16_t TB_BLUE_SEARCH_ANIM_Y = 102; + static constexpr int16_t TB_BLUE_SEARCH_ANIM_W = 64; + static constexpr int16_t TB_BLUE_SEARCH_ANIM_H = 64; + static constexpr int16_t TB_BLUE_SEARCH_ANIM_FRAMES = 24; + static constexpr int16_t TB_BLUE_SEARCH_ANIM_INTERVAL = 33; + + // 选择动画配置 + static constexpr int16_t TB_BLUE_SELECT_ANIM_X = 148; + static constexpr int16_t TB_BLUE_SELECT_ANIM_Y = 102; + static constexpr int16_t TB_BLUE_SELECT_ANIM_W = 24; + static constexpr int16_t TB_BLUE_SELECT_ANIM_H = 24; + static constexpr int16_t TB_BLUE_SELECT_ANIM_FRAMES = 49; + static constexpr int16_t TB_BLUE_SELECT_ANIM_INTERVAL = 41; + + // 搜索动画图片路径数组 + static const char *TB_BLUE_SEARCH_PATHS[TB_BLUE_SEARCH_ANIM_FRAMES] = { + TB_SEARCH_IMAGE_1, + TB_SEARCH_IMAGE_2, + TB_SEARCH_IMAGE_3, + TB_SEARCH_IMAGE_4, + TB_SEARCH_IMAGE_5, + TB_SEARCH_IMAGE_6, + TB_SEARCH_IMAGE_7, + TB_SEARCH_IMAGE_8, + TB_SEARCH_IMAGE_9, + TB_SEARCH_IMAGE_10, + TB_SEARCH_IMAGE_11, + TB_SEARCH_IMAGE_12, + TB_SEARCH_IMAGE_13, + TB_SEARCH_IMAGE_14, + TB_SEARCH_IMAGE_15, + TB_SEARCH_IMAGE_16, + TB_SEARCH_IMAGE_17, + TB_SEARCH_IMAGE_18, + TB_SEARCH_IMAGE_19, + TB_SEARCH_IMAGE_20, + TB_SEARCH_IMAGE_21, + TB_SEARCH_IMAGE_22, + TB_SEARCH_IMAGE_23, + TB_SEARCH_IMAGE_24, + }; + + // 选择动画图片路径数组(复用搜索动画图片) + static const char *TB_BLUE_SELECT_PATHS[TB_BLUE_SELECT_ANIM_FRAMES] = { + TB_LIST_IMAGE_1, + TB_LIST_IMAGE_2, + TB_LIST_IMAGE_3, + TB_LIST_IMAGE_4, + TB_LIST_IMAGE_5, + TB_LIST_IMAGE_6, + TB_LIST_IMAGE_7, + TB_LIST_IMAGE_8, + TB_LIST_IMAGE_9, + TB_LIST_IMAGE_10, + TB_LIST_IMAGE_11, + TB_LIST_IMAGE_12, + TB_LIST_IMAGE_13, + TB_LIST_IMAGE_14, + TB_LIST_IMAGE_15, + TB_LIST_IMAGE_16, + TB_LIST_IMAGE_17, + TB_LIST_IMAGE_18, + TB_LIST_IMAGE_19, + TB_LIST_IMAGE_20, + TB_LIST_IMAGE_21, + TB_LIST_IMAGE_22, + TB_LIST_IMAGE_23, + TB_LIST_IMAGE_24, + TB_LIST_IMAGE_25, + TB_LIST_IMAGE_26, + TB_LIST_IMAGE_27, + TB_LIST_IMAGE_28, + TB_LIST_IMAGE_29, + TB_LIST_IMAGE_30, + TB_LIST_IMAGE_31, + TB_LIST_IMAGE_32, + TB_LIST_IMAGE_33, + TB_LIST_IMAGE_34, + TB_LIST_IMAGE_35, + TB_LIST_IMAGE_36, + TB_LIST_IMAGE_37, + TB_LIST_IMAGE_38, + TB_LIST_IMAGE_39, + TB_LIST_IMAGE_40, + TB_LIST_IMAGE_41, + TB_LIST_IMAGE_42, + TB_LIST_IMAGE_43, + TB_LIST_IMAGE_44, + TB_LIST_IMAGE_45, + TB_LIST_IMAGE_46, + TB_LIST_IMAGE_47, + TB_LIST_IMAGE_48, + TB_LIST_IMAGE_49, + }; // 前向声明 class ThunderBirdBlueListAdapter; @@ -21,6 +118,8 @@ namespace OHOS virtual ~ThunderBirdBlueView(); static ThunderBirdBlueView *GetInstance(void); bool EnsureNetAnimator(); + bool EnsureSearchAnimator(); + bool EnsureSelectAnimator(); UIViewGroup *ThunderBirdBlueViewInit(void); void ClearAll(void); void Show(int16_t showView); @@ -66,8 +165,17 @@ namespace OHOS UIImageView *RemindIcon1{nullptr}; UIImageView *RemindIcon2{nullptr}; UIImageView *RemindIcon3{nullptr}; + UIImageView *RemindIcon4{nullptr}; UIList *DeviceList{nullptr}; + // 动画组件 + UIImageAnimatorView *searchAnimator{nullptr}; + UIImageAnimatorView *selectAnimator{nullptr}; + ImageAnimatorInfo searchImageInfo[TB_BLUE_SEARCH_ANIM_FRAMES]; + ImageAnimatorInfo selectImageInfo[TB_BLUE_SELECT_ANIM_FRAMES]; + const char **searchPathsArray{nullptr}; + const char **selectPathsArray{nullptr}; + // 设备列表适配器 ThunderBirdBlueListAdapter *deviceListAdapter_{nullptr}; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h index 9abc07d27..ce3d61614 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h @@ -100,6 +100,8 @@ namespace OHOS void CloseVideo(); // 打开遮罩(部分视图需要) void OpenBackGround(void); + // 刷新黄色背景 + void InvalidateGroup1(bool state); MediaVideoPlay *video_ = nullptr; MediaVideoPlay *videoPlay_ = nullptr; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueView.cpp index 9b1f754b4..15d167da0 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdBlueView.cpp @@ -50,6 +50,8 @@ namespace OHOS if (BackGround != nullptr) { delete BackGround; BackGround = nullptr; } if (DeviceList != nullptr) { delete DeviceList; DeviceList = nullptr; } if (deviceListAdapter_ != nullptr) { delete deviceListAdapter_; deviceListAdapter_ = nullptr; } + if (searchAnimator != nullptr) { delete searchAnimator; searchAnimator = nullptr; } + if (selectAnimator != nullptr) { delete selectAnimator; selectAnimator = nullptr; } } bool ThunderBirdBlueView::EnsureNetAnimator() @@ -58,6 +60,76 @@ namespace OHOS return true; } + bool ThunderBirdBlueView::EnsureSearchAnimator() + { + if (searchAnimator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdBlueView::EnsureSearchAnimator: 创建搜索动画"); + searchPathsArray = TB_BLUE_SEARCH_PATHS; + searchAnimator = new UIImageAnimatorView(); + if (searchAnimator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdBlueView new UIImageAnimatorView fail"); + return false; + } + searchAnimator->SetAutoEnable(false); + for (uint8_t i = 0; i < TB_BLUE_SEARCH_ANIM_FRAMES; i++) + { + searchImageInfo[i].imagePath = (searchPathsArray[i]); + searchImageInfo[i].imageType = IMG_SRC_FILE_PATH; + searchImageInfo[i].pos.x = TB_BLUE_SEARCH_ANIM_X; + searchImageInfo[i].pos.y = TB_BLUE_SEARCH_ANIM_Y; + searchImageInfo[i].width = TB_BLUE_SEARCH_ANIM_W; + searchImageInfo[i].height = TB_BLUE_SEARCH_ANIM_H; + } + searchAnimator->SetPosition(TB_BLUE_SEARCH_ANIM_X, TB_BLUE_SEARCH_ANIM_Y, TB_BLUE_SEARCH_ANIM_W, TB_BLUE_SEARCH_ANIM_H); + searchAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + searchAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + searchAnimator->SetImageAnimatorSrc(searchImageInfo, TB_BLUE_SEARCH_ANIM_FRAMES, TB_BLUE_SEARCH_ANIM_INTERVAL); + searchAnimator->SetRepeat(true); + searchAnimator->SetRepeatTimes(1); + searchAnimator->SetResizeMode(UIImageView::COVER); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdBlueView::EnsureSearchAnimator: 动画配置完成,位置=(%d,%d), 大小=(%d,%d), 帧数=%d", + TB_BLUE_SEARCH_ANIM_X, TB_BLUE_SEARCH_ANIM_Y, TB_BLUE_SEARCH_ANIM_W, TB_BLUE_SEARCH_ANIM_H, TB_BLUE_SEARCH_ANIM_FRAMES); + } + return true; + } + + bool ThunderBirdBlueView::EnsureSelectAnimator() + { + if (selectAnimator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdBlueView::EnsureSelectAnimator: 创建选择动画"); + selectPathsArray = TB_BLUE_SELECT_PATHS; + selectAnimator = new UIImageAnimatorView(); + if (selectAnimator == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdBlueView new UIImageAnimatorView fail"); + return false; + } + selectAnimator->SetAutoEnable(false); + for (uint8_t i = 0; i < TB_BLUE_SELECT_ANIM_FRAMES; i++) + { + selectImageInfo[i].imagePath = (selectPathsArray[i]); + selectImageInfo[i].imageType = IMG_SRC_FILE_PATH; + selectImageInfo[i].pos.x = TB_BLUE_SELECT_ANIM_X; + selectImageInfo[i].pos.y = TB_BLUE_SELECT_ANIM_Y; + selectImageInfo[i].width = TB_BLUE_SELECT_ANIM_W; + selectImageInfo[i].height = TB_BLUE_SELECT_ANIM_H; + } + selectAnimator->SetPosition(TB_BLUE_SELECT_ANIM_X, TB_BLUE_SELECT_ANIM_Y, TB_BLUE_SELECT_ANIM_W, TB_BLUE_SELECT_ANIM_H); + selectAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + selectAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + selectAnimator->SetImageAnimatorSrc(selectImageInfo, TB_BLUE_SELECT_ANIM_FRAMES, TB_BLUE_SELECT_ANIM_INTERVAL); + selectAnimator->SetRepeat(true); + selectAnimator->SetRepeatTimes(1); + selectAnimator->SetResizeMode(UIImageView::COVER); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdBlueView::EnsureSelectAnimator: 动画配置完成,位置=(%d,%d), 大小=(%d,%d), 帧数=%d", + TB_BLUE_SELECT_ANIM_X, TB_BLUE_SELECT_ANIM_Y, TB_BLUE_SELECT_ANIM_W, TB_BLUE_SELECT_ANIM_H, TB_BLUE_SELECT_ANIM_FRAMES); + } + return true; + } + void ThunderBirdBlueView::InitDeviceListAdapter(void) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdBlueView::InitDeviceListAdapter"); @@ -89,13 +161,14 @@ namespace OHOS BackGround->SetSrc("/user/res/yellowbg.bin"); BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0xff); BackGround->SetResizeMode(UIImageView::CONTAIN); - BackGround->SetVisible(true); + BackGround->SetVisible(false); group->Add(BackGround); } if(!EnsureNetAnimator()) { return nullptr; } + TextLabel = new UILabelExt(); if (TextLabel) { @@ -144,6 +217,14 @@ namespace OHOS RemindIcon3->SetResizeMode(UIImageView::CONTAIN); group->Add(RemindIcon3); } + RemindIcon4 = new UIImageView(); + if (RemindIcon4) + { + RemindIcon4->SetAutoEnable(false); + RemindIcon4->SetVisible(false); + RemindIcon4->SetResizeMode(UIImageView::CONTAIN); + group->Add(RemindIcon4); + } RemindLabel = new UILabelExt(); if (RemindLabel) { @@ -176,6 +257,16 @@ namespace OHOS DeviceList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); // 透明背景 group->Add(DeviceList); } + if(!EnsureSearchAnimator()) + { + return nullptr; + } + if(!EnsureSelectAnimator()) + { + return nullptr; + } + group->Add(searchAnimator); + group->Add(selectAnimator); // 初始化设备列表适配器 InitDeviceListAdapter(); @@ -197,7 +288,10 @@ namespace OHOS if (RemindIcon1) { RemindIcon1->SetVisible(false); } if (RemindIcon2) { RemindIcon2->SetVisible(false); } if (RemindIcon3) { RemindIcon3->SetVisible(false); } + if (RemindIcon4) { RemindIcon4->SetVisible(false); } if (DeviceList) { DeviceList->SetVisible(false); } + if (searchAnimator) { searchAnimator->SetVisible(false); searchAnimator->Stop(); } + if (selectAnimator) { selectAnimator->SetVisible(false); selectAnimator->Stop(); } switch (showView) { @@ -219,18 +313,18 @@ namespace OHOS if (RemindIcon) { RemindIcon->SetPosition(148, 102, 64, 64); - RemindIcon->SetSrc("/user/res/bluetooth.bin"); + RemindIcon->SetSrc("/user/res/bule_connect.bin"); RemindIcon->SetVisible(true); } if (RemindIcon1) { - RemindIcon1->SetPosition(104, 277, 22, 22); + RemindIcon1->SetPosition(102, 275, 22, 22); RemindIcon1->SetSrc("/user/res/volume_up.bin"); RemindIcon1->SetVisible(true); } if (RemindIcon2) { - RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetPosition(206, 275, 22, 22); RemindIcon2->SetSrc("/user/res/volume_up.bin"); RemindIcon2->SetVisible(true); } @@ -250,22 +344,26 @@ namespace OHOS RemindLabel->SetText("按 取消 长按 退出配对"); RemindLabel->SetVisible(true); } + // 隐藏静态图标,显示搜索动画 if (RemindIcon) { - RemindIcon->SetPosition(148, 102, 64, 64); - RemindIcon->SetSrc("/user/res/bluetooth.bin"); - RemindIcon->SetVisible(true); + RemindIcon->SetVisible(false); + } + if (searchAnimator) + { + searchAnimator->SetVisible(true); + searchAnimator->Start(); } if (RemindIcon1) { - RemindIcon1->SetPosition(79, 277, 22, 22); - RemindIcon1->SetSrc("/user/res/volume_up.bin"); + RemindIcon1->SetPosition(75, 275, 22, 22); + RemindIcon1->SetSrc("/user/res/volume_down.bin"); RemindIcon1->SetVisible(true); } if (RemindIcon2) { - RemindIcon2->SetPosition(207, 277, 22, 22); - RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetPosition(200, 275, 22, 22); + RemindIcon2->SetSrc("/user/res/voice.bin"); RemindIcon2->SetVisible(true); } break; @@ -292,20 +390,20 @@ namespace OHOS } if (RemindIcon) { - RemindIcon->SetPosition(98, 127, 36, 36); - RemindIcon->SetSrc("/user/res/bluetooth.bin"); + RemindIcon->SetPosition(90, 115, 36, 36); + RemindIcon->SetSrc("/user/res/warning.bin"); RemindIcon->SetVisible(true); } if (RemindIcon1) { - RemindIcon1->SetPosition(79, 277, 22, 22); + RemindIcon1->SetPosition(75, 275, 22, 22); RemindIcon1->SetSrc("/user/res/volume_up.bin"); RemindIcon1->SetVisible(true); } if (RemindIcon2) { - RemindIcon2->SetPosition(207, 277, 22, 22); - RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetPosition(200, 275, 22, 22); + RemindIcon2->SetSrc("/user/res/voice.bin"); RemindIcon2->SetVisible(true); } break; @@ -322,6 +420,7 @@ namespace OHOS { TextLabel_2->SetPosition(30, 184, 300, 28); TextLabel_2->SetText("请确保蓝牙设备在范围内并已开启"); + TextLabel_2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); TextLabel_2->SetVisible(true); } if (RemindLabel) @@ -332,20 +431,20 @@ namespace OHOS } if (RemindIcon) { - RemindIcon->SetPosition(90, 127, 36, 36); - RemindIcon->SetSrc("/user/res/bluetooth.bin"); + RemindIcon->SetPosition(90, 115, 36, 36); + RemindIcon->SetSrc("/user/res/warning.bin"); RemindIcon->SetVisible(true); } if (RemindIcon1) { - RemindIcon1->SetPosition(79, 277, 22, 22); + RemindIcon1->SetPosition(75, 275, 22, 22); RemindIcon1->SetSrc("/user/res/volume_up.bin"); RemindIcon1->SetVisible(true); } if (RemindIcon2) { - RemindIcon2->SetPosition(207, 277, 22, 22); - RemindIcon2->SetSrc("/user/res/volume_up.bin"); + RemindIcon2->SetPosition(200, 275, 22, 22); + RemindIcon2->SetSrc("/user/res/voice.bin"); RemindIcon2->SetVisible(true); } break; @@ -354,6 +453,20 @@ namespace OHOS { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Show DEVICE_LIST view"); + // 停止搜索动画 + if (searchAnimator) + { + searchAnimator->SetVisible(false); + searchAnimator->Stop(); + } + + // 显示选择动画 + if (selectAnimator) + { + // selectAnimator->SetVisible(true); + // selectAnimator->Start(); + } + // 不显示标题(列表中已有分组标题) if (TextLabel) { @@ -387,13 +500,13 @@ namespace OHOS } if (RemindLabel) { - RemindLabel->SetPosition(44, 260, 272, 25); - RemindLabel->SetText("按 +/- 选择 按 确认"); + RemindLabel->SetPosition(66, 275, 272, 25); + RemindLabel->SetText("按 / 选择 按 确认"); RemindLabel->SetVisible(true); } if (RemindLabel_2) { - RemindLabel_2->SetPosition(109, 285, 142, 25); + RemindLabel_2->SetPosition(109, 310, 150, 25); RemindLabel_2->SetText("长按 退出配对"); RemindLabel_2->SetVisible(true); } @@ -403,22 +516,28 @@ namespace OHOS } if (RemindIcon1) { - RemindIcon1->SetPosition(68, 262, 22, 22); - RemindIcon1->SetSrc("/user/res/volume_up.bin"); + RemindIcon1->SetPosition(88, 275, 22, 22); + RemindIcon1->SetSrc("/user/res/volume_down.bin"); RemindIcon1->SetVisible(true); } if (RemindIcon2) { - RemindIcon2->SetPosition(183, 262, 22, 22); + RemindIcon2->SetPosition(120, 275, 22, 22); RemindIcon2->SetSrc("/user/res/volume_up.bin"); RemindIcon2->SetVisible(true); } if (RemindIcon3) { - RemindIcon3->SetPosition(151, 287, 22, 22); - RemindIcon3->SetSrc("/user/res/volume_up.bin"); + RemindIcon3->SetPosition(220, 275, 22, 22); + RemindIcon3->SetSrc("/user/res/voice.bin"); RemindIcon3->SetVisible(true); } + if (RemindIcon4) + { + RemindIcon4->SetPosition(150, 310, 22, 22); + RemindIcon4->SetSrc("/user/res/voice.bin"); + RemindIcon4->SetVisible(true); + } break; } case THUNDERBIRD_BULEVIEW_CONNECT_SUCCESS: @@ -442,25 +561,25 @@ namespace OHOS if (RemindLabel) { RemindLabel->SetPosition(44, 260, 272, 25); - RemindLabel->SetText("按 +/- 选择 按 连接"); + RemindLabel->SetText("按 返回列表 按 断开连接"); RemindLabel->SetVisible(true); } if (RemindLabel_2) { - RemindLabel_2->SetPosition(109, 285, 142, 25); + RemindLabel_2->SetPosition(109, 310, 150, 25); RemindLabel_2->SetText("长按 退出配对"); RemindLabel_2->SetVisible(true); } if (RemindIcon) { RemindIcon->SetPosition(68, 127, 36, 36); - RemindIcon->SetSrc("/user/res/bluetooth.bin"); + RemindIcon->SetSrc("/user/res/completed.bin"); RemindIcon->SetVisible(true); } if (RemindIcon1) { RemindIcon1->SetPosition(68, 262, 22, 22); - RemindIcon1->SetSrc("/user/res/volume_up.bin"); + RemindIcon1->SetSrc("/user/res/volume_down.bin"); RemindIcon1->SetVisible(true); } if (RemindIcon2) @@ -471,8 +590,8 @@ namespace OHOS } if (RemindIcon3) { - RemindIcon3->SetPosition(151, 287, 22, 22); - RemindIcon3->SetSrc("/user/res/volume_up.bin"); + RemindIcon3->SetPosition(150, 310, 22, 22); + RemindIcon3->SetSrc("/user/res/voice.bin"); RemindIcon3->SetVisible(true); } break; @@ -497,32 +616,32 @@ namespace OHOS } if (RemindLabel) { - RemindLabel->SetPosition(80, 275, 272, 25); - RemindLabel->SetText("按 返回列表 长按 确认"); + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 重试"); RemindLabel->SetVisible(true); } if (RemindLabel_2) { - RemindLabel_2->SetPosition(109, 310, 142, 25); + RemindLabel_2->SetPosition(109, 310, 150, 25); RemindLabel_2->SetText("长按 退出配对"); RemindLabel_2->SetVisible(true); } if (RemindIcon1) { - RemindIcon1->SetPosition(68, 277, 22, 22); - RemindIcon1->SetSrc("/user/res/volume_up.bin"); + RemindIcon1->SetPosition(105, 276, 22, 22); + RemindIcon1->SetSrc("/user/res/volume_down.bin"); RemindIcon1->SetVisible(true); } if (RemindIcon2) { - RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetPosition(211, 276, 22, 22); RemindIcon2->SetSrc("/user/res/volume_up.bin"); RemindIcon2->SetVisible(true); } if (RemindIcon3) { - RemindIcon3->SetPosition(151, 312, 22, 22); - RemindIcon3->SetSrc("/user/res/volume_up.bin"); + RemindIcon3->SetPosition(150, 310, 22, 22); + RemindIcon3->SetSrc("/user/res/voice.bin"); RemindIcon3->SetVisible(true); } break; @@ -544,12 +663,12 @@ namespace OHOS if (RemindIcon) { RemindIcon->SetPosition(148, 102, 64, 64); - RemindIcon->SetSrc("/user/res/completed.bin"); + RemindIcon->SetSrc("/user/res/bule_disconnect.bin"); RemindIcon->SetVisible(true); } if (RemindIcon1) { - RemindIcon1->SetPosition(160, 277, 22, 22); + RemindIcon1->SetPosition(160, 275, 22, 22); RemindIcon1->SetSrc("/user/res/volume_up.bin"); RemindIcon1->SetVisible(true); } @@ -565,38 +684,39 @@ namespace OHOS } if (RemindLabel) { - RemindLabel->SetPosition(80, 275, 272, 25); - RemindLabel->SetText("按 返回列表 长按 确认"); + RemindLabel->SetPosition(80, 275, 200, 25); + RemindLabel->SetText("按 退出 按 重试"); RemindLabel->SetVisible(true); } if (RemindLabel_2) { - RemindLabel_2->SetPosition(109, 310, 142, 25); + RemindLabel_2->SetPosition(109, 310, 150, 25); RemindLabel_2->SetText("长按 退出配对"); RemindLabel_2->SetVisible(true); } - if (RemindIcon) - { - RemindIcon->SetPosition(68, 151, 36, 36); - RemindIcon->SetSrc("/user/res/bluetooth.bin"); - RemindIcon->SetVisible(true); - } + if (RemindIcon1) { - RemindIcon1->SetPosition(68, 277, 22, 22); - RemindIcon1->SetSrc("/user/res/volume_up.bin"); + RemindIcon1->SetPosition(105, 276, 22, 22); + RemindIcon1->SetSrc("/user/res/volume_down.bin"); RemindIcon1->SetVisible(true); } if (RemindIcon2) { - RemindIcon2->SetPosition(216, 277, 22, 22); + RemindIcon2->SetPosition(211, 276, 22, 22); RemindIcon2->SetSrc("/user/res/volume_up.bin"); RemindIcon2->SetVisible(true); } + if (RemindIcon) + { + RemindIcon->SetPosition(68, 151, 36, 36); + RemindIcon->SetSrc("/user/res/warning.bin"); + RemindIcon->SetVisible(true); + } if (RemindIcon3) { - RemindIcon3->SetPosition(151, 312, 22, 22); - RemindIcon3->SetSrc("/user/res/volume_up.bin"); + RemindIcon3->SetPosition(150, 310, 22, 22); + RemindIcon3->SetSrc("/user/res/voice.bin"); RemindIcon3->SetVisible(true); } break; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp index 02f1f59a5..e5640c651 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp @@ -653,6 +653,10 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView:: SystemViewId Overstep ones bounds"); return; } + if(hideView == THUNDERBIRD_BLUEVIEW) + { + InvalidateGroup1(false); + } if (hideView != MAXVIEW) { if (group[hideView] == nullptr) @@ -729,6 +733,7 @@ namespace OHOS case THUNDERBIRD_BLUEVIEW: if (g_pThunderBirdBlueView) { + InvalidateGroup1(true); g_pThunderBirdBlueView->Show(subView); } break; @@ -746,6 +751,19 @@ namespace OHOS iconView->SetVisible(true); backGroundView->SetVisible(true); } + void ThunderBirdMainView::InvalidateGroup1(bool state)//黄色背景刷新 + { + if(state == true) + { + iconView->SetVisible(true); + iconView->SetSrc("/user/res/yellowbg.bin"); + } + else + { + iconView->SetVisible(false); + iconView->SetSrc("/user/res/1.bin"); + } + } int16_t ThunderBirdMainView::GetCurrentView() const { 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 index bfc88eca7..2950d993b 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -73,7 +73,7 @@ extern "C" { //最低视频帧率 #define LOW_FREQUENCE 20 //最高视频帧率 - #define HIGH_FREQUENCE 30 + #define HIGH_FREQUENCE 50 namespace OHOS { enum OTA_STATUS @@ -2786,7 +2786,7 @@ extern "C" { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "录音开始,跳转到聆听状态"); view->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING); ThunderBirdDialogueView::GetInstance()->IsNormalEnd = false; - ThunderBirdDialogueView::GetInstance()->UpdateDialogueText("超认真聆听中"); + // ThunderBirdDialogueView::GetInstance()->UpdateDialogueText("超认真聆听中"); } // 如果当前在哄睡界面,且不在故事选择状态,则跳转到故事选择状态 else {