From 05d0b67fbfa0b1618c4638ef6fabef78810d3204 Mon Sep 17 00:00:00 2001 From: cheng Date: Sat, 24 Aug 2024 19:25:13 +0800 Subject: [PATCH] schedule ui --- .../schedule/include/ScheduleListAdapter.h | 1 + .../schedule/include/ScheduleListItem.h | 9 +- .../nativeui/schedule/include/ScheduleModel.h | 30 +- .../nativeui/schedule/include/ScheduleView.h | 88 +- .../schedule/src/ScheduleListAdapter.cpp | 5 + .../schedule/src/ScheduleListItem.cpp | 18 +- .../nativeui/schedule/src/ScheduleModel.cpp | 143 ++-- .../schedule/src/SchedulePresenter.cpp | 56 +- .../nativeui/schedule/src/ScheduleView.cpp | 754 ++++++++++++------ 9 files changed, 719 insertions(+), 385 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleListAdapter.h b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleListAdapter.h index e98c1ff8c..e60be8630 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleListAdapter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleListAdapter.h @@ -20,6 +20,7 @@ namespace OHOS UIView * GetView(UIView * inView, int16_t index) override; uint16_t GetCount() override; void AddListItem(const ScheduleListItemInfo &item); + void ClearListItem(void); void SetItemClickListener(UIView::OnClickListener *itemClickListener); diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleListItem.h b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleListItem.h index 222fcba4d..80508611b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleListItem.h +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleListItem.h @@ -16,11 +16,10 @@ namespace OHOS std::string DateStr; std::string TopicStr; std::string TimeStr; - std::string DataStr; - uint8_t index; - bool is_date_item; - uint8_t child_num; // if(true == is_date_item) - uint8_t child_index; // if(false == is_date_item) + std::string ContentStr; + uint8_t OriginalDataIndex; + bool IsDateItem; + uint8_t ChildIndex; // if(false == IsDateItem) } ScheduleListItemInfo; diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleModel.h b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleModel.h index 14ab8869b..2028510ec 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleModel.h @@ -13,16 +13,18 @@ namespace OHOS { public: static ScheduleModel &GetInstance(void); - bool ScheduleDataIsEmpty(void); - ScheduleListItemInfo * ScheduleDataInfoGet(void); - uint8_t ScheduleDataItemCountGet(void); - std::string ScheduleInfoDateStrGet(uint8_t index); - std::string ScheduleInfoTopicStrGet(uint8_t index); - std::string ScheduleInfoTimeStrGet(uint8_t index); - std::string ScheduleInfoDataStrGet(uint8_t index); + ScheduleListItemInfo * ScheduleAllItemDataGet(void); + uint8_t ScheduleItemDataCountGet(void); + uint8_t ScheduleOriginalDataCountGet(void); - void ScheduleSetByApp(ScheduleRevData * data, uint8_t index, bool is_finish); + std::string ScheduleItemDataDateStrGet(uint8_t index); + std::string ScheduleItemDataTopicStrGet(uint8_t index); + std::string ScheduleItemDataTimeStrGet(uint8_t index); + std::string ScheduleItemDataContentStrGet(uint8_t index); + + void ScheduleOriginalDataSetByApp(ScheduleRevData * data, uint8_t index, bool is_finish); + void ScheduleOriginalDataSetByUI(uint8_t index); private: ScheduleModel(); @@ -30,12 +32,16 @@ namespace OHOS ScheduleModel(const ScheduleModel &) = delete; ScheduleModel &operator=(const ScheduleModel &) = delete; - void ScheduleDataItemCountSet(uint8_t count); - void ScheduleDataToInfo(uint8_t DataCount); + void ScheduleItemDataCountSet(uint8_t count); + void ScheduleOriginalDataCountSet(uint8_t count); + void ScheduleOriginalDataToItemData(uint8_t DataCount); - ScheduleRevData ScheduleRevData_[SCHEDULE_DATA_COUNT_MAX] = {nullptr, nullptr, nullptr, nullptr}; - ScheduleListItemInfo ScheduleDataInfo_[SCHEDULE_DATA_COUNT_MAX*2] = {nullptr, nullptr, nullptr, nullptr, 0, false, 0, 0}; + // original data + ScheduleRevData ScheduleOriginalData_[SCHEDULE_DATA_COUNT_MAX] = {nullptr, nullptr, nullptr, nullptr}; + // item data + ScheduleListItemInfo ScheduleItemData_[SCHEDULE_DATA_COUNT_MAX*2] = {nullptr, nullptr, nullptr, nullptr, 0, false, 0}; uint8_t ItemCount_{0}; + uint8_t DataCount_{0}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleView.h b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleView.h index d6faf5c69..940fb0fff 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleView.h @@ -9,7 +9,8 @@ #include "components/ui_image_view.h" #include "components/ui_list.h" #include "components/ui_scroll_view.h" -#include "components/ui_button.h" +// #include "components/ui_button.h" +#include "components/ui_label_button_ext.h" #include "common/screen.h" #include "ui_resource_string.h" @@ -20,15 +21,15 @@ namespace OHOS { - typedef enum - { - ENUM_SCHEDULE_NO_DATA_SCREEN, - ENUM_SCHEDULE_LIST_SCREEN, - ENUM_SCHEDULE_CONTENT_SCREEN, - ENUM_SCHEDULE_DELETE_SCREEN, + #define SCHEDULE_ViewId_NoDataGroup_ "SCHEDULE_ViewId_ContentDeleteButton_" + #define SCHEDULE_ViewId_DataGroup_ "SCHEDULE_ViewId_DataGroup_" + #define SCHEDULE_ViewId_ContentGroup_ "SCHEDULE_ViewId_ContentGroup_" + #define SCHEDULE_ViewId_DeleteGroup_ "SCHEDULE_ViewId_DeleteGroup_" - ENUM_SCHEDULE_MAX_SCREEN - }ENUM_SCHEDULE_SCREEN; + #define SCHEDULE_ViewId_ContentDeleteButton_ "SCHEDULE_ViewId_ContentDeleteButton_" + #define SCHEDULE_ViewId_ContentCloseButton_ "SCHEDULE_ViewId_ContentCloseButton_" + #define SCHEDULE_ViewId_DeleteCancelButton_ "SCHEDULE_ViewId_DeleteCancelButton_" + #define SCHEDULE_ViewId_DeleteOKButton_ "SCHEDULE_ViewId_DeleteOKButton_" class SchedulePresenter; class ScheduleView : public View @@ -42,17 +43,22 @@ namespace OHOS void OnSetUpView() override; void OnTearDownView() override; void OnStop() override; - void AddItemToList(const ScheduleListItemInfo &item); - void DisplayContentScreen(uint8_t index); + + void ItemListAdd(const ScheduleListItemInfo &item); + void ItemListClear(void); + void ItemListContentUpdate(void); + + void ContentScreenItemIndexSet(uint8_t index); + uint8_t ContentScreenItemIndexGet(void); + + void DisplayDataOrNoScreen(void); + void DisplayContentScreen(void); + void DisplayDeleteScreen(void); private: UIViewGroup * InitNoDataScreen(); - UIViewGroup * InitDataScreen(); UILabelExt * InitLabel(int16_t x, int16_t y, int16_t width, int16_t height, uint16_t line_height, uint8_t font_size, uint16_t text_id, uint32_t text_color); - void DisplayMainScreen(void); - - UIScrollView * InitContentScreen(); UIViewGroup * NoDataGroup_{nullptr}; UILabelExt * LabelExt0_{nullptr}; @@ -60,24 +66,54 @@ namespace OHOS UILabelExt * LabelExt1_{nullptr}; UILabelExt * LabelExt2_{nullptr}; + + UIViewGroup * InitDataScreen(); UIViewGroup * DataGroup_{nullptr}; UIList * ScheduleList_{nullptr}; ScheduleListAdapter * ScheduleListAdapter_{nullptr}; - UIScrollView * ContentGroup_{nullptr}; - UILabelExt * ContentLabelExt0_{nullptr}; - UILabelExt * ContentLabelExt1_{nullptr}; - UILabelExt * ContentLabelExt2_{nullptr}; - UILabelExt * ContentLabelExt3_{nullptr}; - UIButton * ContentButton0_{nullptr}; - UIButton * ContentButton1_{nullptr}; - - UIViewGroup * GroupArray_[ENUM_SCHEDULE_MAX_SCREEN]{nullptr}; + UIScrollView * InitContentScreen(); + UIScrollView * ContentGroup_{nullptr}; + UILabelExt * ContentDateLabelExt_{nullptr}; + UILabelExt * ContentTopicLabelExt_{nullptr}; + UILabelExt * ContentTopicLabelExt1_{nullptr}; + UILabelExt * ContentTimeLabelExt_{nullptr}; + UILabelExt * ContentTimeLabelExt1_{nullptr}; + UILabelExt * ContentContentLabelExt_{nullptr}; + UILabelExt * ContentContentLabelExt1_{nullptr}; + UILabelButtonExt * ContentDeleteButton_{nullptr}; + UILabelButtonExt * ContentCloseButton_{nullptr}; + uint8_t ContentItemIndex_{0}; + + + UIViewGroup * InitDeleteScreen(); + UIViewGroup * DeleteGroup_{nullptr}; + UILabelExt * DeleteTitleLabelExt_{nullptr}; + UILabelExt * DeletePromptLabelExt_{nullptr}; + UILabelButtonExt * DeleteCancelButton_{nullptr}; + UILabelButtonExt * DeleteOKButton_{nullptr}; + + + void DisplaySelectScreen(uint8_t ScreenIndex); + typedef enum + { + ENUM_SCHEDULE_SCREEN_NO_DATA, + ENUM_SCHEDULE_SCREEN_LIST, + ENUM_SCHEDULE_SCREEN_CONTENT, + ENUM_SCHEDULE_SCREEN_DELETE, + + ENUM_SCHEDULE_SCREEN_MAX + }ENUM_SCHEDULE_SCREEN; + UIViewGroup * ScreenGroupArray_[ENUM_SCHEDULE_SCREEN_MAX]{nullptr}; + + + #define SCREEN_WIDTH (Screen::GetInstance().GetWidth()) + #define SCREEN_HEIGHT (Screen::GetInstance().GetHeight()) #define LIST_LEFT (43) #define LIST_TOP (50) - #define LIST_WIDTH (Screen::GetInstance().GetWidth() - LIST_LEFT * 2) - #define LIST_HEIGHT (Screen::GetInstance().GetHeight() - LIST_TOP * 2) + #define LIST_WIDTH (SCREEN_WIDTH - LIST_LEFT * 2) + #define LIST_HEIGHT (SCREEN_HEIGHT - LIST_TOP * 2) #define NO_DATA_IMAGE "/user/res/Schedule/schedule_no_data.bin" }; diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleListAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleListAdapter.cpp index d1312f219..2b4477dc9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleListAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleListAdapter.cpp @@ -73,6 +73,11 @@ namespace OHOS nodeList_.PushBack(item); } + void ScheduleListAdapter::ClearListItem(void) + { + nodeList_.Clear(); + } + void ScheduleListAdapter::SetItemClickListener(UIView::OnClickListener *itemClickListener) { itemClickListener_ = itemClickListener; diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleListItem.cpp b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleListItem.cpp index b53ed61a9..33e57ba2a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleListItem.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleListItem.cpp @@ -50,7 +50,7 @@ namespace OHOS Image_.SetPosition(326, 37, 14, 26); Image_.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); - Image_.SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + Image_.SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); Image_.SetResizeMode(UIImageView::CENTER); Image_.SetAutoEnable(false); Image_.SetSrc(IMAGE_ITEM_ARROW); @@ -65,17 +65,18 @@ namespace OHOS ScheduleListItem::~ScheduleListItem() { RemoveAll(); + InfoGroup_.RemoveAll(); } void ScheduleListItem::SetItemInfo(const ScheduleListItemInfo &itemInfo) { - if(true == itemInfo.is_date_item) + if(true == itemInfo.IsDateItem) { LabelExtDate_.SetText(itemInfo.DateStr.c_str()); } else { - if(0 == (itemInfo.child_index % 2)) + if(0 == (itemInfo.ChildIndex % 2)) { LabelExtTopic_.SetText(itemInfo.TopicStr.c_str()); LabelExtTime_.SetText(itemInfo.TimeStr.c_str()); @@ -90,13 +91,14 @@ namespace OHOS void ScheduleListItem::ResetItemStyle(const ScheduleListItemInfo &itemInfo) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:ResetItemStyle,%d,%d,%d", - __LINE__, itemInfo.is_date_item, itemInfo.child_num, itemInfo.child_index); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:ResetItemStyle,%d,%d", + __LINE__, itemInfo.IsDateItem, itemInfo.ChildIndex); - if(true == itemInfo.is_date_item) + if(true == itemInfo.IsDateItem) { - SetHeight(ITEM_HEIGHT); + // SetHeight(ITEM_HEIGHT- ITEM_GAP); + // InfoGroup_.SetHeight(ITEM_HEIGHT- ITEM_GAP); InfoGroup_.SetStyle(STYLE_BACKGROUND_COLOR, OHOS::Color::Black().full); InfoGroup_.SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); InfoGroup_.SetTouchable(false); @@ -108,7 +110,7 @@ namespace OHOS } else { - if(0 == (itemInfo.child_index % 2)) + if(0 == (itemInfo.ChildIndex % 2)) { InfoGroup_.SetStyle(STYLE_BACKGROUND_COLOR, ODD_ITEM_BACKGROUND_COLOR); InfoGroup_.SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleModel.cpp index 1ed145c5e..fbab247f3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleModel.cpp @@ -20,118 +20,140 @@ namespace OHOS return instance; } - bool ScheduleModel::ScheduleDataIsEmpty(void) + uint8_t ScheduleModel::ScheduleItemDataCountGet(void) { - if(0 == ItemCount_) - return true; - - return false; + return ItemCount_; } - uint8_t ScheduleModel::ScheduleDataItemCountGet(void) + void ScheduleModel::ScheduleItemDataCountSet(uint8_t count) { - return ItemCount_; + ItemCount_ = count; } - void ScheduleModel::ScheduleDataItemCountSet(uint8_t count) + uint8_t ScheduleModel::ScheduleOriginalDataCountGet(void) { - ItemCount_ = count; + return DataCount_; } - ScheduleListItemInfo * ScheduleModel::ScheduleDataInfoGet(void) + void ScheduleModel::ScheduleOriginalDataCountSet(uint8_t count) { - return ScheduleDataInfo_; + DataCount_ = count; } - std::string ScheduleModel::ScheduleInfoDateStrGet(uint8_t index) + ScheduleListItemInfo * ScheduleModel::ScheduleAllItemDataGet(void) { - return ScheduleDataInfo_[index].DateStr.c_str(); + return ScheduleItemData_; } - std::string ScheduleModel::ScheduleInfoTopicStrGet(uint8_t index) + std::string ScheduleModel::ScheduleItemDataDateStrGet(uint8_t index) { - return ScheduleDataInfo_[index].TopicStr.c_str(); + return ScheduleItemData_[index].DateStr.c_str(); } - std::string ScheduleModel::ScheduleInfoTimeStrGet(uint8_t index) + std::string ScheduleModel::ScheduleItemDataTopicStrGet(uint8_t index) { - return ScheduleDataInfo_[index].TimeStr.c_str(); + return ScheduleItemData_[index].TopicStr.c_str(); } - std::string ScheduleModel::ScheduleInfoDataStrGet(uint8_t index) + std::string ScheduleModel::ScheduleItemDataTimeStrGet(uint8_t index) { - return ScheduleDataInfo_[index].DataStr.c_str(); + return ScheduleItemData_[index].TimeStr.c_str(); } - void ScheduleModel::ScheduleSetByApp(ScheduleRevData * data, uint8_t index, bool is_finish) + std::string ScheduleModel::ScheduleItemDataContentStrGet(uint8_t index) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleModel::ScheduleSetByApp,%d,%d", index, is_finish); + return ScheduleItemData_[index].ContentStr.c_str(); + } + + void ScheduleModel::ScheduleOriginalDataSetByApp(ScheduleRevData * data, uint8_t index, bool is_finish) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleModel::ScheduleOriginalDataSetByApp,%d,%d", index, is_finish); - ScheduleRevData_[index].date.assign(data->date); - ScheduleRevData_[index].topic.assign(data->topic); - ScheduleRevData_[index].time.assign(data->time); - ScheduleRevData_[index].content.assign(data->content); + ScheduleOriginalData_[index].date.assign(data->date); + ScheduleOriginalData_[index].topic.assign(data->topic); + ScheduleOriginalData_[index].time.assign(data->time); + ScheduleOriginalData_[index].content.assign(data->content); if(true == is_finish) { uint8_t DataCount = index + 1; - ScheduleDataToInfo(DataCount); + ScheduleOriginalDataCountSet(DataCount); + ScheduleOriginalDataToItemData(DataCount); } } - void ScheduleModel::ScheduleDataToInfo(uint8_t DataCount) + void ScheduleModel::ScheduleOriginalDataSetByUI(uint8_t index) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleModel::ScheduleDataToInfo,%d", DataCount); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleModel::ScheduleOriginalDataSetByUI,%d", index); + + uint8_t DataCount = ScheduleOriginalDataCountGet(); + uint8_t i = 0; + for(i = index; i < (DataCount - 1); i++) + { + ScheduleOriginalData_[i].date.assign(ScheduleOriginalData_[i + 1].date); + ScheduleOriginalData_[i].topic.assign(ScheduleOriginalData_[i + 1].topic); + ScheduleOriginalData_[i].time.assign(ScheduleOriginalData_[i + 1].time); + ScheduleOriginalData_[i].content.assign(ScheduleOriginalData_[i + 1].content); + } + + DataCount -= 1; + ScheduleOriginalDataCountSet(DataCount); + ScheduleOriginalDataToItemData(DataCount); + } + + void ScheduleModel::ScheduleOriginalDataToItemData(uint8_t DataCount) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleModel::ScheduleOriginalDataToItemData,%d", DataCount); uint8_t i = 0; uint8_t j = 0; - memset(ScheduleDataInfo_, 0x0, sizeof(ScheduleListItemInfo) * SCHEDULE_DATA_COUNT_MAX*2); + memset(ScheduleItemData_, 0x0, sizeof(ScheduleListItemInfo) * SCHEDULE_DATA_COUNT_MAX*2); for(i = 0, j = 0; i < DataCount; i++) { if(0 == i) { - ScheduleDataInfo_[j].DateStr.assign(ScheduleRevData_[i].date); - ScheduleDataInfo_[j].index = j; - ScheduleDataInfo_[j].is_date_item = true; + ScheduleItemData_[j].DateStr.assign(ScheduleOriginalData_[i].date); + ScheduleItemData_[j].OriginalDataIndex = i; + ScheduleItemData_[j].IsDateItem = true; j++; - ScheduleDataInfo_[j].DateStr.assign(ScheduleRevData_[i].date); - ScheduleDataInfo_[j].TopicStr.assign(ScheduleRevData_[i].topic); - ScheduleDataInfo_[j].TimeStr.assign(ScheduleRevData_[i].time); - ScheduleDataInfo_[j].DataStr.assign(ScheduleRevData_[i].content); - ScheduleDataInfo_[j].index = j; - ScheduleDataInfo_[j].is_date_item = false; - ScheduleDataInfo_[j].child_index = 0; + ScheduleItemData_[j].DateStr.assign(ScheduleOriginalData_[i].date); + ScheduleItemData_[j].TopicStr.assign(ScheduleOriginalData_[i].topic); + ScheduleItemData_[j].TimeStr.assign(ScheduleOriginalData_[i].time); + ScheduleItemData_[j].ContentStr.assign(ScheduleOriginalData_[i].content); + ScheduleItemData_[j].OriginalDataIndex = i; + ScheduleItemData_[j].IsDateItem = false; + ScheduleItemData_[j].ChildIndex = 0; } else { - if(0 == ScheduleRevData_[i].date.compare(ScheduleRevData_[i - 1].date)) + if(0 == ScheduleOriginalData_[i].date.compare(ScheduleOriginalData_[i - 1].date)) { j++; - ScheduleDataInfo_[j].DateStr.assign(ScheduleRevData_[i].date); - ScheduleDataInfo_[j].TopicStr.assign(ScheduleRevData_[i].topic); - ScheduleDataInfo_[j].TimeStr.assign(ScheduleRevData_[i].time); - ScheduleDataInfo_[j].DataStr.assign(ScheduleRevData_[i].content); - ScheduleDataInfo_[j].index = j; - ScheduleDataInfo_[j].is_date_item = false; - ScheduleDataInfo_[j].child_index = ScheduleDataInfo_[i - 1].child_index + 1; + ScheduleItemData_[j].DateStr.assign(ScheduleOriginalData_[i].date); + ScheduleItemData_[j].TopicStr.assign(ScheduleOriginalData_[i].topic); + ScheduleItemData_[j].TimeStr.assign(ScheduleOriginalData_[i].time); + ScheduleItemData_[j].ContentStr.assign(ScheduleOriginalData_[i].content); + ScheduleItemData_[j].OriginalDataIndex = i; + ScheduleItemData_[j].IsDateItem = false; + ScheduleItemData_[j].ChildIndex = ScheduleItemData_[j - 1].ChildIndex + 1; } else { j++; - ScheduleDataInfo_[j].DateStr.assign(ScheduleRevData_[i].date); - ScheduleDataInfo_[j].index = j; - ScheduleDataInfo_[j].is_date_item = true; + ScheduleItemData_[j].DateStr.assign(ScheduleOriginalData_[i].date); + ScheduleItemData_[j].OriginalDataIndex = i; + ScheduleItemData_[j].IsDateItem = true; j++; - ScheduleDataInfo_[j].DateStr.assign(ScheduleRevData_[i].date); - ScheduleDataInfo_[j].TopicStr.assign(ScheduleRevData_[i].topic); - ScheduleDataInfo_[j].TimeStr.assign(ScheduleRevData_[i].time); - ScheduleDataInfo_[j].DataStr.assign(ScheduleRevData_[i].content); - ScheduleDataInfo_[j].index = j; - ScheduleDataInfo_[j].is_date_item = false; - ScheduleDataInfo_[j].child_index = 0; + ScheduleItemData_[j].DateStr.assign(ScheduleOriginalData_[i].date); + ScheduleItemData_[j].TopicStr.assign(ScheduleOriginalData_[i].topic); + ScheduleItemData_[j].TimeStr.assign(ScheduleOriginalData_[i].time); + ScheduleItemData_[j].ContentStr.assign(ScheduleOriginalData_[i].content); + ScheduleItemData_[j].OriginalDataIndex = i; + ScheduleItemData_[j].IsDateItem = false; + ScheduleItemData_[j].ChildIndex = 0; } } @@ -142,14 +164,15 @@ namespace OHOS } uint8_t ItemCount = j + 1; - ScheduleDataItemCountSet(ItemCount); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleModel::ScheduleDataToInfo,%d,%s", j, ScheduleDataInfo_[0].DateStr.c_str()); + ScheduleItemDataCountSet(ItemCount); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleModel::ScheduleOriginalDataToItemData,%d,%s", j, ScheduleItemData_[0].DateStr.c_str()); } + // c func void C_ScheduleSetByApp(ScheduleRevData * data, uint8_t index, bool is_finish) { - ScheduleModel::GetInstance().ScheduleSetByApp(data, index, is_finish); + ScheduleModel::GetInstance().ScheduleOriginalDataSetByApp(data, index, is_finish); } int C_ScheduleDataReadFromFile() diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/SchedulePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/SchedulePresenter.cpp index 82370ed95..458ef3891 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/SchedulePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/SchedulePresenter.cpp @@ -51,11 +51,7 @@ namespace OHOS return; } - ScheduleListItemInfo * ItemInfo = ScheduleModel_->ScheduleDataInfoGet(); - for (uint8_t i = 0; i < ScheduleModel_->ScheduleDataItemCountGet(); i++) - { - view_->AddItemToList(ItemInfo[i]); - } + view_->ItemListContentUpdate(); } // 页面准备切换到后台前执行的逻辑 @@ -75,20 +71,43 @@ namespace OHOS bool SchedulePresenter::OnClick(UIView &view, const ClickEvent &event) { UNUSED(event); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SchedulePresenter::OnClick"); -#if 0 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:OnClick", __LINE__); + if (nullptr == &view) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:OnClick", __LINE__); return false; - } - else + } + + if(0 == strcmp(view.GetViewId(), SCHEDULE_ViewId_ContentDeleteButton_)) + { + view_->DisplayDeleteScreen(); + return true; + } + if(0 == strcmp(view.GetViewId(), SCHEDULE_ViewId_ContentCloseButton_)) + { + view_->DisplayDataOrNoScreen(); + return true; + } + + if(0 == strcmp(view.GetViewId(), SCHEDULE_ViewId_DeleteCancelButton_)) + { + view_->DisplayContentScreen(); + return true; + } + if(0 == strcmp(view.GetViewId(), SCHEDULE_ViewId_DeleteOKButton_)) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:OnClick", __LINE__); ScheduleListItem * item = static_cast(&view); - view_->DisplayContentScreen(item->GetViewIndex()); + ScheduleModel_->ScheduleOriginalDataSetByUI(item->GetViewIndex()); + view_->ItemListContentUpdate(); + view_->DisplayDataOrNoScreen(); + return true; } -#endif + + ScheduleListItem * item = static_cast(&view); + view_->ContentScreenItemIndexSet(item->GetViewIndex()); + view_->DisplayContentScreen(); + return true; } @@ -109,6 +128,17 @@ namespace OHOS // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SchedulePresenter::OnDragEnd"); if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && SchedulePresenter::X_DRAG_FLAG) { + if(0 == strcmp(view.GetViewId(), SCHEDULE_ViewId_ContentGroup_)) + { + view_->DisplayDataOrNoScreen(); + return true; + } + if(0 == strcmp(view.GetViewId(), SCHEDULE_ViewId_DeleteGroup_)) + { + view_->DisplayContentScreen(); + return true; + } + NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); SchedulePresenter::X_DRAG_FLAG = false; } @@ -122,7 +152,7 @@ namespace OHOS uint16_t keyID = event.GetKeyId(); uint16_t keyState = event.GetState(); // 如果是power键,且是亮屏状态,按键释放就返回上一级 - if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleView.cpp b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleView.cpp index d3672cbf1..2389dbfbd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleView.cpp @@ -1,5 +1,6 @@ #include "schedule/include/ScheduleView.h" +#include "UiConfig.h" #include "wearable_log.h" namespace OHOS @@ -34,12 +35,24 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]", __LINE__); return; } - container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + container_->SetPosition(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); container_->SetTouchable(true); container_->SetDraggable(true); - container_->SetOnDragListener(presenter_); - container_->Add(InitNoDataScreen()); - container_->Add(InitDataScreen()); + // container_->SetOnDragListener(presenter_); + + ScreenGroupArray_[ENUM_SCHEDULE_SCREEN_NO_DATA] = InitNoDataScreen(); + ScreenGroupArray_[ENUM_SCHEDULE_SCREEN_LIST] = InitDataScreen(); + ScreenGroupArray_[ENUM_SCHEDULE_SCREEN_CONTENT] = InitContentScreen(); + ScreenGroupArray_[ENUM_SCHEDULE_SCREEN_DELETE] = InitDeleteScreen(); + + uint8_t i = 0; + for(i = 0; i < ENUM_SCHEDULE_SCREEN_MAX; i++) + { + if(nullptr != ScreenGroupArray_[i]) + { + container_->Add(ScreenGroupArray_[i]); + } + } RootView::GetInstance()->SetOnKeyActListener(presenter_); } @@ -49,8 +62,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScheduleView::OnSetUpView"); View::OnSetUpView(); - DisplayMainScreen(); - // GroupArray_ + DisplayDataOrNoScreen(); Draw(); } @@ -116,35 +128,50 @@ namespace OHOS if(nullptr != ContentGroup_) { ContentGroup_->RemoveAll(); - if(nullptr != ContentLabelExt0_) + if(nullptr != ContentDateLabelExt_) + { + delete ContentDateLabelExt_; + ContentDateLabelExt_ = nullptr; + } + if(nullptr != ContentTopicLabelExt_) + { + delete ContentTopicLabelExt_; + ContentTopicLabelExt_ = nullptr; + } + if(nullptr != ContentTopicLabelExt1_) { - delete ContentLabelExt0_; - ContentLabelExt0_ = nullptr; + delete ContentTopicLabelExt1_; + ContentTopicLabelExt1_ = nullptr; } - if(nullptr != ContentLabelExt1_) + if(nullptr != ContentTimeLabelExt_) { - delete ContentLabelExt1_; - ContentLabelExt1_ = nullptr; + delete ContentTimeLabelExt_; + ContentTimeLabelExt_ = nullptr; } - if(nullptr != ContentLabelExt2_) + if(nullptr != ContentTimeLabelExt1_) { - delete ContentLabelExt2_; - ContentLabelExt2_ = nullptr; + delete ContentTimeLabelExt1_; + ContentTimeLabelExt1_ = nullptr; } - if(nullptr != ContentLabelExt3_) + if(nullptr != ContentContentLabelExt_) { - delete ContentLabelExt3_; - ContentLabelExt3_ = nullptr; + delete ContentContentLabelExt_; + ContentContentLabelExt_ = nullptr; } - if(nullptr != ContentButton0_) + if(nullptr != ContentContentLabelExt1_) { - delete ContentButton0_; - ContentButton0_ = nullptr; + delete ContentContentLabelExt1_; + ContentContentLabelExt1_ = nullptr; } - if(nullptr != ContentButton1_) + if(nullptr != ContentDeleteButton_) { - delete ContentButton1_; - ContentButton1_ = nullptr; + delete ContentDeleteButton_; + ContentDeleteButton_ = nullptr; + } + if(nullptr != ContentCloseButton_) + { + delete ContentCloseButton_; + ContentCloseButton_ = nullptr; } delete ContentGroup_; @@ -156,87 +183,93 @@ namespace OHOS } } - void ScheduleView::AddItemToList(const ScheduleListItemInfo &item) - { - ScheduleListAdapter_->AddListItem(item); - } - - void ScheduleView::DisplayMainScreen(void) - { - if(true == ScheduleModel::GetInstance().ScheduleDataIsEmpty()) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:DisplayMainScreen", __LINE__); - NoDataGroup_->SetVisible(true); - DataGroup_->SetVisible(false); - } - else - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:DisplayMainScreen", __LINE__); - NoDataGroup_->SetVisible(false); - DataGroup_->SetVisible(true); - ScheduleList_->RefreshList(); - } - } - -#if 0 - void ScheduleView::_DisplayMainScreen(uint8_t ScreenIndex) + void ScheduleView::DisplaySelectScreen(uint8_t ScreenIndex) { - if(ENUM_SCHEDULE_MAX_SCREEN =< ScreenIndex) + if(ENUM_SCHEDULE_SCREEN_MAX <= ScreenIndex) { return; } uint8_t i = 0; - for(i = 0; i < ENUM_SCHEDULE_MAX_SCREEN; i++) + for(i = 0; i < ENUM_SCHEDULE_SCREEN_MAX; i++) { - if(i == ScreenIndex) - { - GroupArray_[i]->SetVisible(true); - } - else + if(nullptr != ScreenGroupArray_[i]) { - GroupArray_[i]->SetVisible(false); + if(i == ScreenIndex) + { + ScreenGroupArray_[i]->SetVisible(true); + } + else + { + ScreenGroupArray_[i]->SetVisible(false); + } } } + } - if(ENUM_SCHEDULE_LIST_SCREEN == ScreenIndex) + void ScheduleView::DisplayDataOrNoScreen(void) + { + if(0 == ScheduleModel::GetInstance().ScheduleItemDataCountGet()) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:DisplayMainScreen", __LINE__); + DisplaySelectScreen(ENUM_SCHEDULE_SCREEN_NO_DATA); + } + else { - GroupArray_[ENUM_SCHEDULE_LIST_SCREEN]->RefreshList(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:DisplayMainScreen", __LINE__); + DisplaySelectScreen(ENUM_SCHEDULE_SCREEN_LIST); + + ScheduleList_->RefreshList(); } } -#endif - void ScheduleView::DisplayContentScreen(uint8_t index) + void ScheduleView::DisplayContentScreen(void) { - NoDataGroup_->SetVisible(false); - DataGroup_->SetVisible(false); + DisplaySelectScreen(ENUM_SCHEDULE_SCREEN_CONTENT); - UIScrollView * temp_group = InitContentScreen(); - if(nullptr == temp_group) - return; + uint8_t index = ContentScreenItemIndexGet(); + ContentDateLabelExt_->SetText(ScheduleModel::GetInstance().ScheduleItemDataDateStrGet(index).c_str()); - container_->Add(temp_group); + int16_t temp_y = 0; + temp_y = ContentDateLabelExt_->GetY() + ContentDateLabelExt_->GetHeight() + 50; + ContentTopicLabelExt_->SetY(temp_y); + ContentTopicLabelExt1_->SetY(temp_y); + ContentTopicLabelExt1_->SetText(ScheduleModel::GetInstance().ScheduleItemDataTopicStrGet(index).c_str()); - ContentLabelExt0_->SetText(ScheduleModel::GetInstance().ScheduleInfoDateStrGet(index).c_str()); + temp_y = ContentTopicLabelExt_->GetY() + ContentTopicLabelExt_->GetHeight() + 20; + ContentTimeLabelExt_->SetY(temp_y); + ContentTimeLabelExt1_->SetY(temp_y); + ContentTimeLabelExt1_->SetText(ScheduleModel::GetInstance().ScheduleItemDataTimeStrGet(index).c_str()); - int16_t temp_y = 0; - temp_y = ContentLabelExt0_->GetY() + ContentLabelExt0_->GetHeight() + 50; - ContentLabelExt1_->SetY(temp_y); - ContentLabelExt1_->SetText(ScheduleModel::GetInstance().ScheduleInfoTopicStrGet(index).c_str()); + if(true == ScheduleModel::GetInstance().ScheduleItemDataContentStrGet(index).empty()) + { + ContentContentLabelExt_->SetVisible(false); + ContentContentLabelExt1_->SetVisible(false); - temp_y = ContentLabelExt1_->GetY() + ContentLabelExt1_->GetHeight() + 20; - ContentLabelExt2_->SetY(temp_y); - ContentLabelExt2_->SetText(ScheduleModel::GetInstance().ScheduleInfoTimeStrGet(index).c_str()); + temp_y = ContentTimeLabelExt_->GetY() + ContentTimeLabelExt_->GetHeight() + 50; + ContentDeleteButton_->SetY(temp_y); + } + else + { + ContentContentLabelExt_->SetVisible(true); + ContentContentLabelExt1_->SetVisible(true); - temp_y = ContentLabelExt2_->GetY() + ContentLabelExt2_->GetHeight() + 20; - ContentLabelExt3_->SetY(temp_y); - ContentLabelExt3_->SetText(ScheduleModel::GetInstance().ScheduleInfoDataStrGet(index).c_str()); + temp_y = ContentTimeLabelExt_->GetY() + ContentTimeLabelExt_->GetHeight() + 20; + ContentContentLabelExt_->SetY(temp_y); + ContentContentLabelExt1_->SetY(temp_y); + ContentContentLabelExt1_->SetText(ScheduleModel::GetInstance().ScheduleItemDataContentStrGet(index).c_str()); - temp_y = ContentLabelExt3_->GetY() + ContentLabelExt3_->GetHeight() + 50; - ContentButton0_->SetY(temp_y); + temp_y = ContentContentLabelExt1_->GetY() + ContentContentLabelExt1_->GetHeight() + 50; + ContentDeleteButton_->SetY(temp_y); + } - temp_y = ContentButton0_->GetY() + ContentButton0_->GetHeight() + 20; - ContentButton1_->SetY(temp_y); + temp_y = ContentDeleteButton_->GetY() + ContentDeleteButton_->GetHeight() + 20; + ContentCloseButton_->SetY(temp_y); + } + + void ScheduleView::DisplayDeleteScreen(void) + { + DisplaySelectScreen(ENUM_SCHEDULE_SCREEN_DELETE); } UIViewGroup * ScheduleView::InitNoDataScreen() @@ -247,61 +280,60 @@ namespace OHOS NoDataGroup_ = new UIViewGroup(); if(nullptr == NoDataGroup_) return nullptr; - } - NoDataGroup_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - NoDataGroup_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); - NoDataGroup_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); - NoDataGroup_->SetOnDragListener(presenter_); - NoDataGroup_->SetTouchable(true); - NoDataGroup_->SetDraggable(true); - - if(nullptr == LabelExt0_) - { - LabelExt0_ = InitLabel(83, 50, 300, 35, 35, 30, STR_SCHEDULE_TITLE, Color::White().full); + + NoDataGroup_->SetPosition(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + NoDataGroup_->SetViewId(SCHEDULE_ViewId_NoDataGroup_); + NoDataGroup_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + NoDataGroup_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + NoDataGroup_->SetOnDragListener(presenter_); + NoDataGroup_->SetTouchable(true); + NoDataGroup_->SetDraggable(true); + if(nullptr == LabelExt0_) { - return nullptr; + LabelExt0_ = InitLabel(83, 50, 300, 35, 35, 30, STR_SCHEDULE_TITLE, Color::White().full); + if(nullptr == LabelExt0_) + { + return nullptr; + } } - } - if(nullptr == ImageView_) - { - ImageView_ = new UIImageView(); if(nullptr == ImageView_) { - return nullptr; - } + ImageView_ = new UIImageView(); + if(nullptr == ImageView_) + { + return nullptr; + } - ImageView_->SetPosition(175, 150, 116, 120); - // ImageView_->SetAutoEnable(true); - // ImageView_->SetViewId(viewId); - ImageView_->SetSrc(NO_DATA_IMAGE); - } + ImageView_->SetPosition(175, 150, 116, 120); + ImageView_->SetSrc(NO_DATA_IMAGE); + } - if(nullptr == LabelExt1_) - { - LabelExt1_ = InitLabel(53, 330, 360, 35, 35, 30, STR_SCHEDULE_NO_DATA, 0xff999999); if(nullptr == LabelExt1_) { - return nullptr; + LabelExt1_ = InitLabel(53, 330, 360, 35, 35, 30, STR_SCHEDULE_NO_DATA, 0xff999999); + if(nullptr == LabelExt1_) + { + return nullptr; + } } - } - if(nullptr == LabelExt2_) - { - LabelExt2_ = InitLabel(53, 370, 360, 35, 35, 30, STR_SCHEDULE_NO_DATA_PROMPT, 0xff999999); if(nullptr == LabelExt2_) { - return nullptr; + LabelExt2_ = InitLabel(53, 370, 360, 35, 35, 30, STR_SCHEDULE_NO_DATA_PROMPT, 0xff999999); + if(nullptr == LabelExt2_) + { + return nullptr; + } } - } - NoDataGroup_->Add(LabelExt0_); - NoDataGroup_->Add(ImageView_); - NoDataGroup_->Add(LabelExt1_); - NoDataGroup_->Add(LabelExt2_); + NoDataGroup_->Add(LabelExt0_); + NoDataGroup_->Add(ImageView_); + NoDataGroup_->Add(LabelExt1_); + NoDataGroup_->Add(LabelExt2_); + } - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]", __LINE__); return NoDataGroup_; } @@ -313,50 +345,52 @@ namespace OHOS DataGroup_ = new UIViewGroup(); if(nullptr == DataGroup_) return nullptr; - } - DataGroup_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - DataGroup_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); - DataGroup_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); - DataGroup_->SetOnDragListener(presenter_); - DataGroup_->SetTouchable(true); - DataGroup_->SetDraggable(true); - - if(nullptr == ScheduleListAdapter_) - { - ScheduleListAdapter_ = new ScheduleListAdapter(); + + DataGroup_->SetPosition(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + DataGroup_->SetViewId(SCHEDULE_ViewId_DataGroup_); + DataGroup_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + DataGroup_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + DataGroup_->SetOnDragListener(presenter_); + DataGroup_->SetTouchable(true); + DataGroup_->SetDraggable(true); + if(nullptr == ScheduleListAdapter_) - return nullptr; - - ScheduleListAdapter_->SetItemClickListener(presenter_); - } + { + ScheduleListAdapter_ = new ScheduleListAdapter(); + if(nullptr == ScheduleListAdapter_) + return nullptr; + + ScheduleListAdapter_->SetItemClickListener(presenter_); + } - if(nullptr == ScheduleList_) - { - ScheduleList_ = new UIList(); if(nullptr == ScheduleList_) { - return nullptr; + ScheduleList_ = new UIList(); + if(nullptr == ScheduleList_) + { + return nullptr; + } } + ScheduleList_->SetPosition(LIST_LEFT, LIST_TOP, LIST_WIDTH, LIST_HEIGHT); + // ScheduleList_->SetSelectPosition(VERTICAL_RESOLUTION / 2); + ScheduleList_->SetDraggable(true); + ScheduleList_->SetThrowDrag(true); + // ScheduleList_->EnableAutoAlign(true); + ScheduleList_->SetAdapter(ScheduleListAdapter_); + // ScheduleList_->SetScrollStateListener(presenter_); + ScheduleList_->SetMaxScrollDistance(1000); // 1000: max scroll distance + ScheduleList_->SetSwipeACCLevel(800); // 800: compensation distance + ScheduleList_->SetDragACCLevel(5); // 5: drag acceleration + ScheduleList_->SetYScrollBarVisible(false); + + ScheduleList_->SetScrollBlankSize(40); + ScheduleList_->SetReboundSize(30); + + ScheduleList_->SetRotateFactor(2); // 增加表冠控制 + ScheduleList_->RequestFocus(); + + DataGroup_->Add(ScheduleList_); } - ScheduleList_->SetPosition(LIST_LEFT, LIST_TOP, LIST_WIDTH, LIST_HEIGHT); - // ScheduleList_->SetSelectPosition(VERTICAL_RESOLUTION / 2); - ScheduleList_->SetDraggable(true); - ScheduleList_->SetThrowDrag(true); - // ScheduleList_->EnableAutoAlign(true); - ScheduleList_->SetAdapter(ScheduleListAdapter_); - // ScheduleList_->SetScrollStateListener(presenter_); - ScheduleList_->SetMaxScrollDistance(1000); // 1000: max scroll distance - ScheduleList_->SetSwipeACCLevel(800); // 800: compensation distance - ScheduleList_->SetDragACCLevel(5); // 5: drag acceleration - ScheduleList_->SetYScrollBarVisible(false); - - ScheduleList_->SetScrollBlankSize(40); - ScheduleList_->SetReboundSize(30); - - ScheduleList_->SetRotateFactor(2); // 增加表冠控制 - ScheduleList_->RequestFocus(); - - DataGroup_->Add(ScheduleList_); return DataGroup_; } @@ -369,126 +403,290 @@ namespace OHOS ContentGroup_ = new UIScrollView(); if(nullptr == ContentGroup_) return nullptr; - } - // ContentGroup_->SetViewIndex(ENUM_SCHEDULE_CONTENT_SCREEN); - ContentGroup_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - ContentGroup_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); - ContentGroup_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); - ContentGroup_->SetOnDragListener(presenter_); - ContentGroup_->SetTouchable(true); - ContentGroup_->SetDraggable(true); - - ContentGroup_->SetScrollBlankSize(40); - ContentGroup_->SetReboundSize(40); - ContentGroup_->SetDirection(1); - ContentGroup_->SetMaxScrollDistance(1000); - ContentGroup_->SetThrowDrag(true); - ContentGroup_->RequestFocus(); - ContentGroup_->SetRotateFactor(2); - - if(nullptr == ContentLabelExt0_) - { - ContentLabelExt0_ = new UILabelExt(); - if(nullptr == ContentLabelExt0_) - return nullptr; - ContentLabelExt0_->SetPosition(83, 50, 300, 35); - ContentLabelExt0_->SetStyle(STYLE_TEXT_FONT, 30); - ContentLabelExt0_->SetStyle(STYLE_LINE_HEIGHT, 35); - // ContentLabelExt0_->SetTextId(text_id); - ContentLabelExt0_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); - ContentLabelExt0_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - ContentLabelExt0_->SetRollSpeed(70); - ContentLabelExt0_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - ContentLabelExt0_->SetStyle(STYLE_TEXT_COLOR, 0xffff5a36); - } + // ContentGroup_->SetViewIndex(ENUM_SCHEDULE_CONTENT_SCREEN); + ContentGroup_->SetPosition(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + ContentGroup_->SetViewId(SCHEDULE_ViewId_ContentGroup_); + ContentGroup_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + ContentGroup_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + ContentGroup_->SetOnDragListener(presenter_); + ContentGroup_->SetTouchable(true); + ContentGroup_->SetDraggable(true); + + ContentGroup_->SetScrollBlankSize(40); + ContentGroup_->SetReboundSize(40); + ContentGroup_->SetDirection(1); + ContentGroup_->SetMaxScrollDistance(1000); + ContentGroup_->SetThrowDrag(true); + ContentGroup_->RequestFocus(); + ContentGroup_->SetRotateFactor(2); + + if(nullptr == ContentDateLabelExt_) + { + ContentDateLabelExt_ = new UILabelExt(); + if(nullptr == ContentDateLabelExt_) + return nullptr; + + ContentDateLabelExt_->SetPosition(83, 50, 300, 35); + ContentDateLabelExt_->SetStyle(STYLE_TEXT_FONT, 30); + ContentDateLabelExt_->SetStyle(STYLE_LINE_HEIGHT, 35); + // ContentDateLabelExt_->SetTextId(text_id); + ContentDateLabelExt_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + ContentDateLabelExt_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + ContentDateLabelExt_->SetRollSpeed(70); + ContentDateLabelExt_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentDateLabelExt_->SetStyle(STYLE_TEXT_COLOR, 0xffff5a36); + } - if(nullptr == ContentLabelExt1_) - { - ContentLabelExt1_ = new UILabelExt(); - if(nullptr == ContentLabelExt1_) - return nullptr; + if(nullptr == ContentTopicLabelExt_) + { + ContentTopicLabelExt_ = new UILabelExt(); + if(nullptr == ContentTopicLabelExt_) + return nullptr; + + ContentTopicLabelExt_->SetPosition(53, 0, 360, 35); + ContentTopicLabelExt_->SetStyle(STYLE_TEXT_FONT, 30); + ContentTopicLabelExt_->SetStyle(STYLE_LINE_HEIGHT, 35); + ContentTopicLabelExt_->SetTextId(STR_SCHEDULE_TOPIC); + // ContentTopicLabelExt_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + ContentTopicLabelExt_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); + ContentTopicLabelExt_->SetRollSpeed(70); + ContentTopicLabelExt_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentTopicLabelExt_->SetStyle(STYLE_TEXT_COLOR, 0xff999999); + + if(nullptr == ContentTopicLabelExt1_) + { + ContentTopicLabelExt1_ = new UILabelExt(); + if(nullptr == ContentTopicLabelExt1_) + return nullptr; + + uint16 x = ContentTopicLabelExt_->GetX(); + uint16 w = ContentTopicLabelExt_->GetTextWidth(); + ContentTopicLabelExt1_->SetPosition(x + w + 5, 0, 360 - w - 5, 35); + ContentTopicLabelExt1_->SetStyle(STYLE_TEXT_FONT, 30); + ContentTopicLabelExt1_->SetStyle(STYLE_LINE_HEIGHT, 35); + ContentTopicLabelExt1_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + ContentTopicLabelExt1_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); + ContentTopicLabelExt1_->SetRollSpeed(70); + ContentTopicLabelExt1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentTopicLabelExt1_->SetStyle(STYLE_TEXT_COLOR, Color::White().full); + } + } - ContentLabelExt1_->SetPosition(53, 0, 360, 35); - ContentLabelExt1_->SetStyle(STYLE_TEXT_FONT, 30); - ContentLabelExt1_->SetStyle(STYLE_LINE_HEIGHT, 35); - // ContentLabelExt1_->SetTextId(text_id); - ContentLabelExt1_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); - ContentLabelExt1_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); - ContentLabelExt1_->SetRollSpeed(70); - ContentLabelExt1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - ContentLabelExt1_->SetStyle(STYLE_TEXT_COLOR, Color::White().full); - } + if(nullptr == ContentTimeLabelExt_) + { + ContentTimeLabelExt_ = new UILabelExt(); + if(nullptr == ContentTimeLabelExt_) + return nullptr; + + ContentTimeLabelExt_->SetPosition(53, 0, 360, 35); + ContentTimeLabelExt_->SetStyle(STYLE_TEXT_FONT, 30); + ContentTimeLabelExt_->SetStyle(STYLE_LINE_HEIGHT, 35); + ContentTimeLabelExt_->SetTextId(STR_SCHEDULE_TIME); + // ContentTimeLabelExt_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + ContentTimeLabelExt_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); + ContentTimeLabelExt_->SetRollSpeed(70); + ContentTimeLabelExt_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentTimeLabelExt_->SetStyle(STYLE_TEXT_COLOR, 0xff999999); + + if(nullptr == ContentTimeLabelExt1_) + { + ContentTimeLabelExt1_ = new UILabelExt(); + if(nullptr == ContentTimeLabelExt1_) + return nullptr; + + uint16 x = ContentTimeLabelExt_->GetX(); + uint16 w = ContentTimeLabelExt_->GetTextWidth(); + ContentTimeLabelExt1_->SetPosition(x + w + 5, 0, 360 - w - 5, 35); + ContentTimeLabelExt1_->SetStyle(STYLE_TEXT_FONT, 30); + ContentTimeLabelExt1_->SetStyle(STYLE_LINE_HEIGHT, 35); + ContentTimeLabelExt1_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + ContentTimeLabelExt1_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); + ContentTimeLabelExt1_->SetRollSpeed(70); + ContentTimeLabelExt1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentTimeLabelExt1_->SetStyle(STYLE_TEXT_COLOR, Color::White().full); + } + } - if(nullptr == ContentLabelExt2_) - { - ContentLabelExt2_ = new UILabelExt(); - if(nullptr == ContentLabelExt2_) - return nullptr; + if(nullptr == ContentContentLabelExt_) + { + ContentContentLabelExt_ = new UILabelExt(); + if(nullptr == ContentContentLabelExt_) + return nullptr; + + ContentContentLabelExt_->SetPosition(53, 0, 360, 35); + ContentContentLabelExt_->SetStyle(STYLE_TEXT_FONT, 30); + ContentContentLabelExt_->SetStyle(STYLE_LINE_HEIGHT, 35); + ContentContentLabelExt_->SetTextId(STR_SCHEDULE_NOTES); + // ContentContentLabelExt_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + ContentContentLabelExt_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); + ContentContentLabelExt_->SetRollSpeed(70); + ContentContentLabelExt_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentContentLabelExt_->SetStyle(STYLE_TEXT_COLOR, 0xff999999); + + if(nullptr == ContentContentLabelExt1_) + { + ContentContentLabelExt1_ = new UILabelExt(); + if(nullptr == ContentContentLabelExt1_) + return nullptr; + + uint16 x = ContentContentLabelExt_->GetX(); + uint16 w = ContentContentLabelExt_->GetTextWidth(); + ContentContentLabelExt1_->SetPosition(x + w + 5, 0, 360 - w - 5, 35); + ContentContentLabelExt1_->SetStyle(STYLE_TEXT_FONT, 30); + ContentContentLabelExt1_->SetStyle(STYLE_LINE_HEIGHT, 35); + ContentContentLabelExt1_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + ContentContentLabelExt1_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); + ContentContentLabelExt1_->SetRollSpeed(70); + ContentContentLabelExt1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentContentLabelExt1_->SetStyle(STYLE_TEXT_COLOR, Color::White().full); + } + } - ContentLabelExt2_->SetPosition(53, 0, 360, 35); - ContentLabelExt2_->SetStyle(STYLE_TEXT_FONT, 30); - ContentLabelExt2_->SetStyle(STYLE_LINE_HEIGHT, 35); - // ContentLabelExt2_->SetTextId(text_id); - ContentLabelExt2_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); - ContentLabelExt2_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); - ContentLabelExt2_->SetRollSpeed(70); - ContentLabelExt2_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - ContentLabelExt2_->SetStyle(STYLE_TEXT_COLOR, Color::White().full); - } + if(nullptr == ContentDeleteButton_) + { + ContentDeleteButton_ = new UILabelButtonExt(); + if(nullptr == ContentDeleteButton_) + return nullptr; + + ContentDeleteButton_->SetPosition(93, 0, 280, 90); + ContentDeleteButton_->SetViewId(SCHEDULE_ViewId_ContentDeleteButton_); + ContentDeleteButton_->SetStyle(STYLE_BACKGROUND_COLOR, 0xfffd5213); + ContentDeleteButton_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + ContentDeleteButton_->SetStyle(STYLE_BORDER_RADIUS, 100); + ContentDeleteButton_->SetTextId(STR_DELETE); + ContentDeleteButton_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentDeleteButton_->SetStyle(STYLE_LINE_HEIGHT, 35); + ContentDeleteButton_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffd5213, UIButton::PRESSED); + ContentDeleteButton_->SetOnClickListener(presenter_); + } - if(nullptr == ContentLabelExt3_) - { - ContentLabelExt3_ = new UILabelExt(); - if(nullptr == ContentLabelExt3_) - return nullptr; + if(nullptr == ContentCloseButton_) + { + ContentCloseButton_ = new UILabelButtonExt(); + if(nullptr == ContentCloseButton_) + return nullptr; + + ContentCloseButton_->SetPosition(93, 0, 280, 90); + ContentCloseButton_->SetViewId(SCHEDULE_ViewId_ContentCloseButton_); + ContentCloseButton_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + ContentCloseButton_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + ContentCloseButton_->SetStyle(STYLE_BORDER_RADIUS, 100); + ContentCloseButton_->SetTextId(STR_CLOSE); + ContentCloseButton_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + ContentCloseButton_->SetStyle(STYLE_LINE_HEIGHT, 35); + ContentCloseButton_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); + ContentCloseButton_->SetOnClickListener(presenter_); + } - int16_t y = ContentLabelExt2_->GetHeight(); - ContentLabelExt3_->SetPosition(53, 0, 360, 35); - ContentLabelExt3_->SetStyle(STYLE_TEXT_FONT, 30); - ContentLabelExt3_->SetStyle(STYLE_LINE_HEIGHT, 35); - // ContentLabelExt3_->SetTextId(text_id); - ContentLabelExt3_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); - ContentLabelExt3_->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP); - ContentLabelExt3_->SetRollSpeed(70); - ContentLabelExt3_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - ContentLabelExt3_->SetStyle(STYLE_TEXT_COLOR, Color::White().full); + ContentGroup_->Add(ContentDateLabelExt_); + ContentGroup_->Add(ContentTopicLabelExt_); + ContentGroup_->Add(ContentTopicLabelExt1_); + ContentGroup_->Add(ContentTimeLabelExt_); + ContentGroup_->Add(ContentTimeLabelExt1_); + ContentGroup_->Add(ContentContentLabelExt_); + ContentGroup_->Add(ContentContentLabelExt1_); + ContentGroup_->Add(ContentDeleteButton_); + ContentGroup_->Add(ContentCloseButton_); } - if(nullptr == ContentButton0_) + return ContentGroup_; + } + + UIViewGroup * ScheduleView::InitDeleteScreen() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]", __LINE__); + if(nullptr == DeleteGroup_) { - ContentButton0_ = new UIButton(); - if(nullptr == ContentButton0_) + DeleteGroup_ = new UIViewGroup(); + if(nullptr == DeleteGroup_) return nullptr; - ContentButton0_->SetPosition(93, 0, 280, 90); - // ContentButton0_->SetViewId(); - ContentButton0_->SetStyle(STYLE_BACKGROUND_COLOR, 0xfffd5213); - ContentButton0_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); - ContentButton0_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xfffd5213, UIButton::PRESSED); - } + DeleteGroup_->SetPosition(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + DeleteGroup_->SetViewId(SCHEDULE_ViewId_DeleteGroup_); + DeleteGroup_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + DeleteGroup_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + DeleteGroup_->SetTouchable(true); + DeleteGroup_->SetDraggable(true); + DeleteGroup_->SetOnDragListener(presenter_); - if(nullptr == ContentButton1_) - { - ContentButton1_ = new UIButton(); - if(nullptr == ContentButton1_) - return nullptr; + if(nullptr == DeleteTitleLabelExt_) + { + DeleteTitleLabelExt_ = new UILabelExt(); + if(nullptr == DeleteTitleLabelExt_) + return nullptr; + + DeleteTitleLabelExt_->SetPosition(83, 50, 300, 35); + DeleteTitleLabelExt_->SetStyle(STYLE_TEXT_FONT, 30); + DeleteTitleLabelExt_->SetStyle(STYLE_LINE_HEIGHT, 35); + DeleteTitleLabelExt_->SetTextId(STR_DELETE); + DeleteTitleLabelExt_->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + DeleteTitleLabelExt_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + DeleteTitleLabelExt_->SetRollSpeed(70); + DeleteTitleLabelExt_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + DeleteTitleLabelExt_->SetStyle(STYLE_TEXT_COLOR, 0xffff5a36); + } - ContentButton1_->SetPosition(93, 0, 280, 90); - // ContentButton1_->SetViewId(); - ContentButton1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); - ContentButton1_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); - ContentButton1_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); - } + if(nullptr == DeletePromptLabelExt_) + { + DeletePromptLabelExt_ = new UILabelExt(); + if(nullptr == DeletePromptLabelExt_) + return nullptr; + + DeletePromptLabelExt_->SetPosition(98, 187, 270, 35); + DeletePromptLabelExt_->SetStyle(STYLE_TEXT_FONT, 30); + DeletePromptLabelExt_->SetStyle(STYLE_LINE_HEIGHT, 35); + DeletePromptLabelExt_->SetTextId(STR_SCHEDULE_DELETE_PROMPT); + DeletePromptLabelExt_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + DeletePromptLabelExt_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + DeletePromptLabelExt_->SetRollSpeed(70); + DeletePromptLabelExt_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + DeletePromptLabelExt_->SetStyle(STYLE_TEXT_COLOR, Color::White().full); + } - ContentGroup_->Add(ContentLabelExt0_); - ContentGroup_->Add(ContentLabelExt1_); - ContentGroup_->Add(ContentLabelExt2_); - ContentGroup_->Add(ContentLabelExt3_); - ContentGroup_->Add(ContentButton0_); - ContentGroup_->Add(ContentButton1_); + if(nullptr == DeleteCancelButton_) + { + DeleteCancelButton_ = new UILabelButtonExt(); + if(nullptr == DeleteCancelButton_) + return nullptr; + + DeleteCancelButton_->SetPosition(111, 299, 100, 100); + DeleteCancelButton_->SetViewId(SCHEDULE_ViewId_DeleteCancelButton_); + DeleteCancelButton_->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + DeleteCancelButton_->SetStyle(STYLE_BACKGROUND_OPA, 25); // 10% + DeleteCancelButton_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); + DeleteCancelButton_->SetStyleForState(STYLE_BACKGROUND_OPA, 25, UIButton::PRESSED); + DeleteCancelButton_->SetStyle(STYLE_BORDER_RADIUS, 100); + DeleteCancelButton_->SetImagePosition(0, 0); + DeleteCancelButton_->SetImageSrc(PNG_SYSTEM_CHECK_OFF_IMAGE, PNG_SYSTEM_CHECK_OFF_IMAGE); + DeleteCancelButton_->SetOnClickListener(presenter_); + } - return ContentGroup_; + if(nullptr == DeleteOKButton_) + { + DeleteOKButton_ = new UILabelButtonExt(); + if(nullptr == DeleteOKButton_) + return nullptr; + + DeleteOKButton_->SetPosition(256, 299, 100, 100); + DeleteOKButton_->SetViewId(SCHEDULE_ViewId_DeleteOKButton_); + DeleteOKButton_->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); + DeleteOKButton_->SetStyle(STYLE_BACKGROUND_OPA, 25); // 10% + DeleteOKButton_->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); + DeleteOKButton_->SetStyleForState(STYLE_BACKGROUND_OPA, 25, UIButton::PRESSED); + DeleteOKButton_->SetStyle(STYLE_BORDER_RADIUS, 100); + DeleteOKButton_->SetImagePosition(0, 0); + DeleteOKButton_->SetImageSrc(PNG_SYSTEM_CHECK_ON_IMAGE, PNG_SYSTEM_CHECK_ON_IMAGE); + DeleteOKButton_->SetOnClickListener(presenter_); + } + + DeleteGroup_->Add(DeleteTitleLabelExt_); + DeleteGroup_->Add(DeletePromptLabelExt_); + DeleteGroup_->Add(DeleteCancelButton_); + DeleteGroup_->Add(DeleteOKButton_); + } + + return DeleteGroup_; } UILabelExt * ScheduleView::InitLabel(int16_t x, int16_t y, int16_t width, int16_t height, @@ -513,4 +711,38 @@ namespace OHOS return LabelExt; } + void ScheduleView::ContentScreenItemIndexSet(uint8_t index) + { + ContentItemIndex_ = index; + } + + uint8_t ScheduleView::ContentScreenItemIndexGet(void) + { + return ContentItemIndex_; + } + + void ScheduleView::ItemListAdd(const ScheduleListItemInfo &item) + { + ScheduleListAdapter_->AddListItem(item); + } + + void ScheduleView::ItemListClear(void) + { + ScheduleListAdapter_->ClearListItem(); + } + + void ScheduleView::ItemListContentUpdate(void) + { + uint8_t ItemCount = ScheduleModel::GetInstance().ScheduleItemDataCountGet(); + if(0 != ItemCount) + { + ItemListClear(); + ScheduleListItemInfo * ItemInfo = ScheduleModel::GetInstance().ScheduleAllItemDataGet(); + for (uint8_t i = 0; i < ItemCount; i++) + { + ItemListAdd(ItemInfo[i]); + } + } + } + } \ No newline at end of file -- 2.17.1