From: Caisking <3449750381@qq.com> Date: Tue, 23 Apr 2024 08:48:40 +0000 (+0800) Subject: 增加信息通知Slice到Applist X-Git-Tag: release_V1.2.70_20241020_135402~1143 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=fb71a42dc6244138cbdae0be5936240127a0625d;p=mirrors%2FFD230.git 增加信息通知Slice到Applist --- diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index 3de41cc9f..3d7954b23 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -263,6 +263,7 @@ namespace OHOS static constexpr const char *PNG_APPLIST_FLASHLIGHT_IMAGE = APP_LIST_PATH "/flashlight.bin"; // 手电筒 static constexpr const char *PNG_APPLIST_BRIGHTNESSLEVEL_IMAGE = APP_LIST_PATH "/lighting.bin"; // 亮度调节 static constexpr const char *PNG_APPLIST_SAVEELE_IMAGE = APP_LIST_PATH "/save.bin"; // 省电模式 + static constexpr const char *PNG_APPLIST_MESSAGE_IMAGE = APP_LIST_PATH "/message.bin"; // 消息通知 /* ---------------------------------- 快速训练 ---------------------------------- */ static constexpr const char *PNG_TRAING_BOUTTONMORE_IMAGE = APP_RES_PATH "/Training/More.bin"; static constexpr const char *PNG_TRAING_BUTTONGRONG_IMAGE = APP_RES_PATH "/Training/Bouttonground.bin"; diff --git a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp index 7e517c667..76f8d921e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp @@ -25,7 +25,6 @@ namespace OHOS { const AppItem g_nativeAppList[] = { {VIEW_MAIN_ALARM, PNG_APPLIST_ALARM_IMAGE, PNG_APPLIST_ALARM_IMAGE, "闹钟", nullptr}, - {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "设置", nullptr}, {VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, "指南针", nullptr}, {VIEW_BLOODOXY, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, "血氧饱和度", nullptr}, {VIEW_HEART, PNG_APPLIST_HEART_IMAGE, PNG_APPLIST_HEART_IMAGE, "心率检测", nullptr}, @@ -45,6 +44,8 @@ namespace OHOS {VIEW_FLASHLIGHT, PNG_APPLIST_FLASHLIGHT_IMAGE, PNG_APPLIST_FLASHLIGHT_IMAGE, "手电筒", nullptr}, {VIEW_BRIGHTNESSLEVEL, PNG_APPLIST_BRIGHTNESSLEVEL_IMAGE, PNG_APPLIST_BRIGHTNESSLEVEL_IMAGE, "亮度调节", nullptr}, {VIEW_SAVEELE, PNG_APPLIST_SAVEELE_IMAGE, PNG_APPLIST_SAVEELE_IMAGE, "省电模式", nullptr}, + {VIEW_MESSAGE, PNG_APPLIST_MESSAGE_IMAGE, PNG_APPLIST_MESSAGE_IMAGE, "消息通知", nullptr}, + {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "设置", nullptr}, #ifdef SUPPORT_ALIPAY_SEC {VIEW_MAIN_ALIPAY, PNG_APPLIST_ALIPAY_IMAGE, PNG_APPLIST_ALIPAY_IMAGE, "支付宝", nullptr}, #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h index a023c612a..cf4e5e188 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h @@ -1,3 +1,9 @@ +/*** + * @Date: 2024-04-15 10:55:58 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-04-23 15:40:41 + * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h + */ #ifndef Message_PRESENTER_H #define Message_PRESENTER_H @@ -30,7 +36,6 @@ namespace OHOS // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; bool OnClick(UIView &view, const ClickEvent &event) override; bool OnDrag(UIView &view, const DragEvent &event) override; - bool DragYInner(int16_t distance) override; MessageModel *p_MessageModel{nullptr}; }; } // namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h index c678b105c..7266ff5e5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h @@ -1,3 +1,9 @@ +/*** + * @Date: 2024-04-15 10:55:58 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-04-23 15:32:55 + * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h + */ #ifndef Message_VIEW_H #define Message_VIEW_H @@ -9,11 +15,18 @@ #include "components/ui_list.h" #include "message/include/MessageAdapter.h" #include "message/include/MessageModel.h" +#include "components/ui_image_view.h" + namespace OHOS { + enum class PopupMessgae + { + LackPopup, + MessagePopup + }; class MessagePresenter; class MessageModel; - class MessageView : public View,public UIViewGroup + class MessageView : public View { public: @@ -25,25 +38,34 @@ namespace OHOS void OnSetUpView() override; void OnTearDownView() override; void OnStop() override; - void AddMessageToList(const MessageListItem &item); - bool InitPage(); - bool SetupViewPage(MessageView *messageView); - UIList *GetList(); + // void AddMessageToList(const MessageListItem &item); + + void ShowLackView(); + void ShowMessageView(); + void SetPopupViewStatus(PopupMessgae view, bool status); - private: void InitView(void); void DeInitView(void); void PreLoad(void); private: - UIScrollView *scrollView = nullptr; + UIScrollView *container_ = nullptr; + UILabel *title{nullptr}; MessageListAdapter *p_MessageListAdapter{nullptr}; - UIList *MessageList = nullptr; + UIList *MessageList = nullptr; UIView::OnDragListener *draglistener{nullptr}; - MessagePresenter *g_MessagePresenter{nullptr}; - MessageModel *g_MessageModel{nullptr}; + /*无消息界面*/ + UIScrollView *lackView{nullptr}; + UIImageView *imageline{nullptr}; + UIImageView *imagemeage{nullptr}; + UILabelExt *labeltitle{nullptr}; + UILabelExt *labelmeage{nullptr}; + + /*消息列表界面*/ + UIScrollView *messageView{nullptr}; + bool viewInitStatus{false}; }; } // namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp index ff1790150..be2c8baa4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp @@ -35,6 +35,14 @@ namespace OHOS { delete messageview; messageview = nullptr; + delete labeltitle; + labeltitle = nullptr; + delete labelmeage; + labelmeage = nullptr; + delete imageline; + imageline = nullptr; + delete imagemeage; + imagemeage = nullptr; } } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp index 8ba26d142..80810d0d9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp @@ -1,7 +1,13 @@ +/*** + * @Date: 2024-04-15 10:55:58 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-04-23 15:38:33 + * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp + */ #include "AppViewIDs.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "NativeAbility.h" #include "message/include/MessagePresenter.h" #include "message/include/MessageAdapter.h" @@ -33,8 +39,7 @@ namespace OHOS void MessagePresenter::OnStart() { - // 初始化歌曲信息 - p_MessageModel->InitMessageListItem(); + // p_MessageModel->InitMessageListItem(); Presenter::OnStart(); } @@ -46,15 +51,6 @@ namespace OHOS void MessagePresenter::OnResume(void) { - if (view_ == nullptr) - { - return; - } - const MessageListItem *itemInfo = p_MessageModel->GetMessagelistItems(); - for (int i = 0; i < p_MessageModel->GetMessageListNum(); i++) - { - view_->AddMessageToList(itemInfo[i]); - } Presenter::OnResume(); } @@ -65,19 +61,19 @@ namespace OHOS bool MessagePresenter::OnDrag(UIView &view, const DragEvent &event) { -#if 0 + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) { NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); } -#endif return true; } bool MessagePresenter::OnClick(UIView &view, const ClickEvent &event) { UNUSED(event); +#if 0 MessageItemView *messageItemView = static_cast(&view); int index = messageItemView->GetMessageListIndex(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "index:%d", index); @@ -86,37 +82,8 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnClick is no index"); return false; } - return true; - } - bool MessagePresenter::DragYInner(int16_t distance) - { -#if 0 - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DragYInner"); - int16_t listHeight = GetHeight(); - // 在原有代码的基础上修改,移除滚动空白区域的逻辑 - if (distance > 0) - { - if (childrenHead_) - { - distance = -childrenHead_->GetY(); // 下拉时不留空白区域,直接将子元素移动到顶部 - } - } - else - { - if (childrenTail_) - { - if (childrenTail_->GetRelativeRect().GetBottom() <= listHeight - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM)) - { - distance = 0; // 下拉时不留空白区域,直接将子元素移动到底部 - } - else - { - distance = listHeight - childrenTail_->GetY() - childrenTail_->GetRelativeRect().GetHeight() - childrenTail_->GetStyle(STYLE_MARGIN_BOTTOM); - } - } - } - return UIList::MoveOffset(0, distance); #endif + return true; } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp index 446a56408..0c1a6d4ba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp @@ -5,15 +5,18 @@ #include "UiConfig.h" #include "wearable_log.h" - +#include "uicomponents/UIComponents.h" namespace OHOS { + static constexpr char *lineimagePath = "/user/res/message/Line 1.bin"; + static constexpr char *messageimagePath = "/user/res/message//message.bin"; + static const uint32_t BACK_GROUND_COLOR = 0xfff6f6f6; + static constexpr uint8_t NUM_2 = 2; static MessageView *g_pMessageView{nullptr}; MessageView::MessageView() { - UIViewGroup::SetPosition(42, 120, 380, 960); g_pMessageView = this; } @@ -30,50 +33,56 @@ namespace OHOS { return g_pMessageView; } - void MessageView::InitView() { - if (scrollView == nullptr) - { - scrollView = new UIScrollView(); - } - scrollView->SetPosition(0, 0, 380, 466); - // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(35); - scrollView->SetReboundSize(50); - scrollView->SetTouchable(true); - scrollView->SetDraggable(true); - scrollView->SetDirection(1); - draglistener = static_cast(MessagePresenter::GetInstance()); - scrollView->SetOnDragListener(draglistener); - /* -------------------------------------------------------------------------- */ - // UIList 的适配器 - p_MessageListAdapter = new MessageListAdapter(); - p_MessageListAdapter->SetItemClickListener(presenter_); - if (MessageList == nullptr) + if (container_ == nullptr) { - MessageList = new UIList(); + container_ = new UIScrollView(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); } - MessageList->SetPosition(43, 120, 380, 600); - MessageList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); - } - UIList *MessageView::GetList() - { - return MessageList; + // 展示无记录界面。后续需要加入函数判断 + SetPopupViewStatus(PopupMessgae::LackPopup, true); } void MessageView::DeInitView() { - // scrollView-> RemoveAll(); - RemoveAll(); - delete title; - title = nullptr; - - delete MessageList; - MessageList = nullptr; - - delete scrollView; - scrollView = nullptr; - + container_->RemoveAll(); + if (labeltitle != nullptr) + { + lackView->Remove(labeltitle); + delete labeltitle; + labeltitle = nullptr; + } + if (labelmeage != nullptr) + { + lackView->Remove(labelmeage); + delete labelmeage; + labelmeage = nullptr; + } + if (imageline != nullptr) + { + lackView->Remove(imageline); + delete imageline; + imageline = nullptr; + } + if (imagemeage != nullptr) + { + lackView->Remove(imagemeage); + delete imagemeage; + imagemeage = nullptr; + } + if (lackView != nullptr) + { + lackView->RemoveAll(); + delete lackView; + lackView = nullptr; + } + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } delete draglistener; draglistener = nullptr; } @@ -87,29 +96,108 @@ namespace OHOS } } - /// @brief 添加歌曲到list - /// @param item - void MessageView::AddMessageToList(const MessageListItem &item) + void MessageView::ShowLackView() { - p_MessageListAdapter->AddListItem(item); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowLackView start"); + lackView = new UIScrollView(); + if (lackView == nullptr) + { + return; + } + lackView->SetPosition(0, 0); + lackView->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); + lackView->SetScrollBlankSize(20); + lackView->SetReboundSize(50); + lackView->SetDirection(1); + /*初始化label*/ + InitLabelDefault(labeltitle, 83, 50, 300, 35, "labletitle", "通知"); + InitLabelDefault(labelmeage, 53, 276, 360, 40, "labelrecord", "暂无内容"); + labelmeage->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff)); + /*初始化image*/ + InitImageView(imageline, 193, 30, 365, 35, "image", lineimagePath); + InitImageView(imagemeage, 183, 156, 100, 100, "image", messageimagePath); + + lackView->Add(imageline); + lackView->Add(imagemeage); + lackView->Add(labeltitle); + lackView->Add(labelmeage); + + RootView::GetInstance()->Add(lackView); + lackView->SetDraggable(true); + lackView->SetTouchable(true); + + UIView::OnDragListener *draglistener = static_cast(MessagePresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + lackView->SetOnDragListener(draglistener); + + lackView->SetVisible(false); // 界面隐藏 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowLackView end"); + } + + void MessageView::ShowMessageView() + { + } + void MessageView::SetPopupViewStatus(PopupMessgae view, bool status) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetPopupViewStatus %d", view); + UIView *popupView = nullptr; + if (view == PopupMessgae::LackPopup) + { + popupView = lackView; + } + else if (view == PopupMessgae::MessagePopup) + { + popupView = messageView; + } + + if (popupView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PopupView is NULL"); + return; + } + + if (container_ != nullptr) + { + container_->SetVisible(!status); + } + + popupView->SetVisible(status); } /// @brief 页面启动时需要执行的代码逻辑 void MessageView::OnStart() { + container_ = new UIScrollView(); + if (container_ == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "container_ new fail"); + return; + } + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + // 创建 draglistener 实例并设置为拖动监听器 + UIView::OnDragListener *draglistener = static_cast(MessagePresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + container_->SetTouchable(true); + container_->SetDraggable(true); + container_->SetStyle(STYLE_BACKGROUND_COLOR, BACK_GROUND_COLOR); + container_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + + ShowLackView(); PreLoad(); + RootView::GetInstance()->Add(container_); } /// @brief 创建页面的视图。 void MessageView::OnSetUpView() { View::OnSetUpView(); - // scrollView->Add(title); - scrollView->Add(MessageList); - scrollView->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); - RootView::GetInstance()->Add(scrollView); - MessageList->SetAdapter(p_MessageListAdapter); - // MessageList->RefreshList(); // 刷新列表 Draw(); } @@ -127,7 +215,19 @@ namespace OHOS RootView::GetInstance()->RemoveAll(); return; } - /* -------------------------------------------------------------------------- */ +#if 0 + UIList *MessageView::GetList() + { + return MessageList; + } + + /// @brief 添加歌曲到list + /// @param item + void MessageView::AddMessageToList(const MessageListItem &item) + { + p_MessageListAdapter->AddListItem(item); + } + /* -------------------------------------------------------------------------- */ // 初始化页面 bool MessageView::InitPage() { @@ -173,5 +273,5 @@ namespace OHOS } return true; } - +#endif } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h index be23114e6..32ef59e1e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h @@ -217,7 +217,7 @@ namespace OHOS static TraingModel *GetInstance(void); void Init(); - /* --------------------------------- 训练组件初始化 -------------------------------- */ + /* --------------------------------- 组件初始化 -------------------------------- */ /*初始化label[可使用text]*/ bool InitLabel(UILabelExt *&label, int left, int top, int width, int height, const char *viewId, const char *text, const char *fontName, int fontSize); /*初始化labelExt*/ @@ -232,11 +232,6 @@ namespace OHOS const char **CreateImagePathsArray(const char *basePath, const char *fileExtension, int numImages); /*初始化动画资源*/ void InitImageAnimatorSource(UIImageAnimatorView *&imageAnimator, const char **imagePaths, int numFrames, int left, int top, int width, int height, const char *viewId, int time); - /*InitLabel[默认参数]*/ - void InitLabelDefault(UILabelExt *&label, int x, int y, int width, int height, const char *viewId, const char *text, int fontSize = 30, const char *fontName = DEFAULT_VECTOR_FONT_FILENAME) - { - InitLabel(label, x, y, width, height, viewId, text, fontName, fontSize); - } /* -------------------------------------------------------------------------- */ /*定时器 */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h index 90b0a71f2..c4e4d0ba5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h @@ -25,7 +25,7 @@ namespace OHOS { #define BUTTONGO "button_go" - enum class PopupView + enum class PopupRecord { LackPopup, RecordPopup @@ -49,7 +49,7 @@ namespace OHOS void ShowLackView(); void ShowRecordView(); - void SetPopupViewStatus(PopupView view, bool status); + void SetPopupViewStatus(PopupRecord view, bool status); private: UIView::OnDragListener *draglistener{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp index 875c3b6e1..0db274499 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp @@ -6,6 +6,7 @@ #include "ui_resource_image.h" #include #include "components/ui_button.h" +#include "uicomponents/UIComponents.h" namespace OHOS { static const uint32_t BACK_GROUND_COLOR = 0xfff6f6f6; @@ -38,7 +39,7 @@ namespace OHOS container_->SetStyle(STYLE_BACKGROUND_OPA, 0); } // 展示无记录界面。后续需要加入函数判断 - SetPopupViewStatus(PopupView::LackPopup, true); + SetPopupViewStatus(PopupRecord::LackPopup, true); } /* DeInit:删除组件 */ @@ -113,12 +114,12 @@ namespace OHOS lackView->SetReboundSize(50); lackView->SetDirection(1); /*初始化label*/ - TraingModel::GetInstance()->InitLabelDefault(labeltitle_, 83, 50, 300, 35, "labletitle", "训练记录"); - TraingModel::GetInstance()->InitLabelDefault(labelrecord_, 53, 260, 360, 40, "labelrecord", "无记录"); + InitLabelDefault(labeltitle_, 83, 50, 300, 35, "labletitle", "训练记录"); + InitLabelDefault(labelrecord_, 53, 260, 360, 40, "labelrecord", "无记录"); /*初始化image*/ - TraingModel::GetInstance()->InitImageView(imagerecord, 174, 120, 118, 120, "image", RECOED_IMAGE); + InitImageView(imagerecord, 174, 120, 118, 120, "image", RECOED_IMAGE); /*初始化按键*/ - TraingModel::GetInstance()->InitButtonExt(buttongo, 93, 330, 280, 90, BUTTONGO, STR_TRAINING, 26); + InitButtonExt(buttongo, 93, 330, 280, 90, BUTTONGO, STR_TRAINING, 26); buttongo->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); // 设置按键颜色 buttongo->SetOnClickListener(static_cast(TraingRecordPresenter::GetInstance())); @@ -146,15 +147,15 @@ namespace OHOS { } /*控制显示界面*/ - void TraingRecordView::SetPopupViewStatus(PopupView view, bool status) + void TraingRecordView::SetPopupViewStatus(PopupRecord view, bool status) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetPopupViewStatus %d", view); UIView *popupView = nullptr; - if (view == PopupView::LackPopup) + if (view == PopupRecord::LackPopup) { popupView = lackView; } - else if (view == PopupView::RecordPopup) + else if (view == PopupRecord::RecordPopup) { popupView = recordView; }