From: Caisking <3449750381@qq.com> Date: Fri, 4 Oct 2024 12:57:21 +0000 (+0800) Subject: 训练:修改训练”更多“列表样式 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=afdfb9e873557d53ee59f8b1fdf652a152a32ecb;p=mirrors%2FFD230.git 训练:修改训练”更多“列表样式 --- afdfb9e873557d53ee59f8b1fdf652a152a32ecb diff --cc code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/include/TraingMoreModel.h index ef1f6c63c,ef1f6c63c..ffa0b51e5 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/include/TraingMoreModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/include/TraingMoreModel.h @@@ -35,7 -35,7 +35,7 @@@ namespace OHO TraingMoreModel(const TraingMoreModel &); TraingMoreModel &operator=(const TraingMoreModel &); virtual ~TraingMoreModel(); -- static const uint16_t TraingMoreListMaxNum = 7; ++ static const uint16_t TraingMoreListMaxNum = 9; TraingMoreItem TraingMores[TraingMoreListMaxNum] = {VIEW_INVALID, STR_ICE_SPORTS, nullptr}; // std::map TraingMoreIdToViewId; bool btConnectStatus{false}; diff --cc code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/include/TraingMoreView.h index 5eaa40dbf,5eaa40dbf..4d835f1c8 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/include/TraingMoreView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/include/TraingMoreView.h @@@ -40,7 -40,7 +40,7 @@@ namespace OHO private: UIScrollView *scrollView = nullptr; -- UILabelExt *title{nullptr}; ++ // UILabelExt *title{nullptr}; TraingMoreAdapter *p_TraingMoreListAdapter{nullptr}; UIList *TraingMoreList = nullptr; UIView::OnDragListener *draglistener{nullptr}; diff --cc code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreItemView.cpp index dd80467de,dd80467de..bf1cde681 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreItemView.cpp @@@ -43,8 -43,8 +43,40 @@@ namespace OHO void TraingMoreItemView::SetItemInfo(const TraingMoreItem itemInfo) { sItemInfo = itemInfo; -- sLabel.SetTextId(itemInfo.labelid); -- slogo.SetSrc(itemInfo.logo); ++ if(itemInfo.id == VIEW_TRAININGMORE) ++ { ++ sLabel.SetTextId(STR_TRAINING); ++ sLabel.SetPosition(90, 50, 200, 35); ++ ++ sicon.SetVisible(false); ++ sbackground.SetVisible(false); ++ slogo.SetVisible(false); ++ sLabel.SetVisible(true); ++ sLabel.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); ++ SetHeight(120); ++ } ++ else if(itemInfo.id == VIEW_INVALID) ++ { ++ sLabel.SetVisible(false); ++ sicon.SetVisible(false); ++ sbackground.SetVisible(false); ++ slogo.SetVisible(false); ++ sLabel.SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER); ++ SetHeight(60); ++ } ++ else ++ { ++ sLabel.SetTextId(itemInfo.labelid); ++ slogo.SetSrc(itemInfo.logo); ++ sLabel.SetPosition(105, 33, 200, 35); ++ ++ sbackground.SetVisible(true); ++ sLabel.SetVisible(true); ++ sicon.SetVisible(true); ++ slogo.SetVisible(true); ++ sLabel.SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER); ++ SetHeight(120); ++ } } /// @brief 设置每一个itemview上的组件 @@@ -60,9 -60,9 +92,9 @@@ sicon.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); sLabel.SetPosition(105, 33, 200, 35); -- sLabel.SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); ++ sLabel.SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); // sLabel.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); -- sLabel.SetRollSpeed(0); ++ sLabel.SetRollSpeed(70); sLabel.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); } diff --cc code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreModel.cpp index 4caa87e7e,4caa87e7e..b2843a218 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreModel.cpp @@@ -38,14 -38,14 +38,17 @@@ namespace OHO void TraingMoreModel::InitTraingMoreListItem() { -- TraingMores[0] = {VIEW_TRAININGFITNESS, STR_EXERCISE_LIST, FITNESS_IMAGE}; -- TraingMores[1] = {VIEW_TRAININGDANCE, STR_DANCING_LIST, DANCE_IMAGE}; -- TraingMores[2] = {VIEW_TRAININGREST, STR_RECREATIONAL_LIST, REST_IMAGE}; -- TraingMores[3] = {VIEW_TRAININGBALL, STR_BALL_LIST, BALL_IMAGE}; ++ int index = 0; ++ TraingMores[index++] = {VIEW_TRAININGMORE, STR_TRAINING, nullptr}; ++ TraingMores[index++] = {VIEW_TRAININGFITNESS, STR_EXERCISE_LIST, FITNESS_IMAGE}; ++ TraingMores[index++] = {VIEW_TRAININGDANCE, STR_DANCING_LIST, DANCE_IMAGE}; ++ TraingMores[index++] = {VIEW_TRAININGREST, STR_RECREATIONAL_LIST, REST_IMAGE}; ++ TraingMores[index++] = {VIEW_TRAININGBALL, STR_BALL_LIST, BALL_IMAGE}; // TraingMores[4] = {VIEW_TRAININGAQUATIC, STR_WATER_LIST, SWIMMING_IMAGE};水上运动 -- TraingMores[4] = {VIEW_TRAININGICE, STR_ICE_LIST, ICE_IMAGE}; -- TraingMores[5] = {VIEW_TRAININGLIMIT, STR_EXTREME_LIST, LIMIT_IMAGE}; -- TraingMores[6] = {VIEW_TRAININGOTHER, STR_OTHER_LIST, OTHER_IMAGE}; ++ TraingMores[index++] = {VIEW_TRAININGICE, STR_ICE_LIST, ICE_IMAGE}; ++ TraingMores[index++] = {VIEW_TRAININGLIMIT, STR_EXTREME_LIST, LIMIT_IMAGE}; ++ TraingMores[index++] = {VIEW_TRAININGOTHER, STR_OTHER_LIST, OTHER_IMAGE}; ++ TraingMores[index++] = {VIEW_INVALID, STR_TRAINING, nullptr}; } const TraingMoreItem *TraingMoreModel::GetTraingMorelistItems() const diff --cc code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreView.cpp index 6625ec982,6625ec982..81993a45b --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreView.cpp @@@ -70,15 -70,15 +70,15 @@@ namespace OHO scrollView->SetDraggable(true); scrollView->SetDirection(1); // scrollView->SetReboundSize(50); // 设置空白大小 -- scrollView->SetScrollBlankSize(75); ++ // scrollView->SetScrollBlankSize(75); scrollView->SetHorizontalScrollState(false); // 设置横向不可滑动 // 设置拖动监听器 scrollView->SetOnDragListener(presenter_); // 初始化 label -- InitLabelExt(title, 125, 52, 200, 60, "label1", STR_TRAINING, DEFAULT_VECTOR_FONT_FILENAME, 30); -- scrollView->Add(title); ++ // InitLabelExt(title, 125, 52, 200, 60, "label1", STR_TRAINING, DEFAULT_VECTOR_FONT_FILENAME, 30); ++ // scrollView->Add(title); // 初始化适配器 p_TraingMoreListAdapter = new TraingMoreAdapter(); @@@ -90,7 -90,7 +90,7 @@@ TraingMoreList = new UIList(); } -- TraingMoreList->SetPosition(More_LIST_POSITION_X, More_LIST_POSITION_Y, 466, 466); ++ TraingMoreList->SetPosition(More_LIST_POSITION_X, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingMoreList->SetThrowDrag(true); TraingMoreList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); TraingMoreList->SetMaxScrollDistance(1000); @@@ -101,7 -101,7 +101,7 @@@ scrollView->SetYScrollBarVisible(true); // 增加表冠控制 -- TraingMoreList->SetRotateFactor(2); ++ TraingMoreList->SetRotateFactor(1); TraingMoreList->RequestFocus(); // 设置键盘事件监听 @@@ -115,8 -115,8 +115,8 @@@ { // scrollView-> RemoveAll(); scrollView->RemoveAll(); -- delete title; -- title = nullptr; ++ // delete title; ++ // title = nullptr; TraingMoreList->RemoveAll(); delete TraingMoreList;