From 75f2dc602d9b05328a0a175559e911dc71f4e833 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Fri, 1 Nov 2024 10:51:34 +0800 Subject: [PATCH] =?utf8?q?=E6=97=A5=E7=A8=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/schedule/include/ScheduleView.h | 3 +++ .../nativeui/schedule/src/ScheduleView.cpp | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) 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 9a8417591..537f42026 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/include/ScheduleView.h @@ -56,6 +56,9 @@ namespace OHOS void DisplayDeleteScreen(void); private: + + void ResetScheduleList(void); + UIViewGroup * InitNoDataScreen(); void DeinitNoDataScreen(); UILabelExt * InitLabel(int16_t x, int16_t y, int16_t width, int16_t height, 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 67957cde4..86b737da4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/schedule/src/ScheduleView.cpp @@ -128,6 +128,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]:DisplayMainScreen", __LINE__); DisplaySelectScreen(ENUM_SCHEDULE_SCREEN_LIST); + ResetScheduleList(); ScheduleList_->RefreshList(); } } @@ -349,6 +350,7 @@ namespace OHOS ScheduleList_->SetRotateFactor(2); // 增加表冠控制 ScheduleList_->RequestFocus(); + ResetScheduleList(); DataGroup_->Add(ScheduleList_); } @@ -793,4 +795,20 @@ namespace OHOS } } + void ScheduleView::ResetScheduleList(void) + { + if(ScheduleListAdapter_ == nullptr || ScheduleList_== nullptr) + { + return; + } + + if(ScheduleListAdapter_->GetCount() > 2) + { + ScheduleList_->SetReboundSize(30); + } + else + { + ScheduleList_->SetReboundSize(0); + } + } } \ No newline at end of file -- 2.17.1