From: Caisking <3449750381@qq.com> Date: Mon, 1 Apr 2024 06:35:06 +0000 (+0800) Subject: 优化训练列表拖拽效果 X-Git-Tag: release_V1.2.70_20241020_135402~1241^2~5 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=ac983c1d3c1b6b8ba98d9dd241f245284dabf495;p=mirrors%2FFD230.git 优化训练列表拖拽效果 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h b/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h index b42db7c95..9fcab03b0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h @@ -18,6 +18,11 @@ namespace OHOS char *oper; // uint8_t signal; }; + struct dial_config + { + char *dialname; + int dialid; + }; public: static ConfigModel *GetInstance(); @@ -40,8 +45,8 @@ namespace OHOS bool GetTradionalBlueToothToggleButtonState(void); void SetHeartRateOrBloodOxygenQuickAccessSwitch(void); int GetHeartRateOrBloodOxygenQuickAccessSwitch(void); - void SetDialId(uint8_t id); - int GetDialId(); + void SetDialId(dial_config *dial); + dial_config *GetDialId(); void SetLanguage(int languageid); int GetLanguage(); char *Getimei(); @@ -67,7 +72,8 @@ namespace OHOS unsigned int ScreenDurationRadioButtonSlectValue{1}; // 亮屏时长 ,0对应5秒熄屏,1对应10秒熄屏,2对应15秒熄屏 bool TradionalBlueToothToggleButtonState{false}; // 用来记录蓝牙开关状态,默认关闭状态 int HeartRateOrBloodOxygenQuickAccessSwitch{0}; // 心率或血氧快速访问开关,默认快速访问血氧打开 - int dialid_; // 表盘id + int dialid_; // 表盘Id + char *dialname_; // 表盘名称 int languageid_; // 语言状态 char *imei_str = NULL; char *pyVer = NULL; diff --git a/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp index 447d4f922..328562b89 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp @@ -129,16 +129,22 @@ namespace OHOS return HeartRateOrBloodOxygenQuickAccessSwitch; } - void ConfigModel::SetDialId(uint8_t id) + void ConfigModel::SetDialId(dial_config *dial) { - dialid_ = id; - WriteJsonData(GetcJSON(), "Dial_Id", id); + dialid_ = dial->dialid; + dialname_ = dial->dialname; + WriteJsonData(GetcJSON(), "Dial_Id", dialid_); + WriteJsonData(GetcJSON(), "Dial_Name", dialname_); } - int ConfigModel::GetDialId() + dial_config *ConfigModel::GetDialId() { dialid_ = (ReadJsonData(GetcJSON(), "Dial_Id")); - return dialid_; + dialname_ = (ReadJsonData(GetcJSON(), "Dial_Name")); + dial_config *dial = new dial_config(); + dial->dialid = dialid_; + dial->dialname = dialname_; + return dial; } void ConfigModel::SetLanguage(int language) diff --git a/code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdateModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdateModel.cpp index 60183a0af..93483ed18 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdateModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdateModel.cpp @@ -112,14 +112,27 @@ namespace OHOS */ uint8_t DialUpdateModel::GetDialConfigPath() { - //避免多次访问 + // 避免多次访问 if (!readstaust) { read_dial(); readstaust = true; } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetDialConfigPath:%d", Current_dial); - Current_dial = ConfigModel::GetInstance()->GetDialId(); + dial_config *dial = ConfigModel::GetInstance()->GetDialId(); + char *Current_dialname = dial.dialname; + Current_dial = dial.dialid; + if (strcmp(dialInfo_1[Current_dial].title, Current_dialname) != 0) + { + for (int i = 0; i < dial_num; i++) + { + if (strcmp(Current_dialname, dialInfo_1[i].title) == 0) + { + Current_dial = i; + break; + } + } + } return Current_dial; } @@ -132,7 +145,11 @@ namespace OHOS if (dialpathid != Current_dial) { Current_dial = dialpathid; // 更新表盘Id - ConfigModel::GetInstance()->SetDialId(Current_dial); + char *Current_dialname = dialInfo_1[Current_dial].title; + dial_config *dial = new dial_config(); + dial->dialid = Current_dial; + dial->dialname = Current_dialname; + ConfigModel::GetInstance()->SetDialId(dial); } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_aquatic/src/TraingAquaticView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_aquatic/src/TraingAquaticView.cpp index e0ee5827b..9090ab33a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_aquatic/src/TraingAquaticView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_aquatic/src/TraingAquaticView.cpp @@ -43,7 +43,7 @@ namespace OHOS { p_TraingAquaticListAdapter->AddItem(item); } - void TraingAquaticView::InitView() + void TraingAquaticView::InitView() { if (scrollView == nullptr) { @@ -51,8 +51,8 @@ namespace OHOS } scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(20); - // scrollView->SetReboundSize(100); + // scrollView->SetScrollBlankSize(52); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -61,7 +61,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1", STR_WATER_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_EXTREME_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + title->SetStyle(STYLE_TEXT_COLOR, Color::Green().full); scrollView->Add(title); // UIList 的适配器 p_TraingAquaticListAdapter = new TraingAquaticAdapter(); @@ -72,10 +73,11 @@ namespace OHOS } TraingAquaticList->SetPosition(Aquatic_LIST_POSITION_X, Aquatic_LIST_POSITION_Y); TraingAquaticList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - // TraingAquaticList->SetScrollBlankSize(Aquatic_SCROLLBLANKSIZE); + TraingAquaticList->SetScrollBlankSize(Aquatic_SCROLLBLANKSIZE); TraingAquaticList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position + TraingAquaticList->SetReboundSize(50); TraingAquaticList->SetDraggable(true); - TraingAquaticList->SetThrowDrag(false); + TraingAquaticList->SetThrowDrag(true); TraingAquaticList->EnableAutoAlign(true); TraingAquaticList->SetElastic(true); // 设置回弹效果 TraingAquaticList->SetMaxScrollDistance(MAX_SCR_DIS); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ball/src/TraingBallView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ball/src/TraingBallView.cpp index 46ebfbd94..05fe6cb09 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ball/src/TraingBallView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ball/src/TraingBallView.cpp @@ -43,7 +43,7 @@ namespace OHOS { p_TraingBallListAdapter->AddItem(item); } - void TraingBallView::InitView() + void TraingBallView::InitView() { if (scrollView == nullptr) { @@ -51,8 +51,8 @@ namespace OHOS } scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(20); - // scrollView->SetReboundSize(100); + // scrollView->SetScrollBlankSize(52); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -61,7 +61,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1", STR_BALL_LIST_TITLE, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_EXTREME_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + title->SetStyle(STYLE_TEXT_COLOR, Color::Green().full); scrollView->Add(title); // UIList 的适配器 p_TraingBallListAdapter = new TraingBallAdapter(); @@ -72,10 +73,11 @@ namespace OHOS } TraingBallList->SetPosition(Ball_LIST_POSITION_X, Ball_LIST_POSITION_Y); TraingBallList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - // TraingBallList->SetScrollBlankSize(Ball_SCROLLBLANKSIZE); + TraingBallList->SetScrollBlankSize(Ball_SCROLLBLANKSIZE); TraingBallList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position + TraingBallList->SetReboundSize(50); TraingBallList->SetDraggable(true); - TraingBallList->SetThrowDrag(false); + TraingBallList->SetThrowDrag(true); TraingBallList->EnableAutoAlign(true); TraingBallList->SetElastic(true); // 设置回弹效果 TraingBallList->SetMaxScrollDistance(MAX_SCR_DIS); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceView.cpp index 15a7b198d..715bf369f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceView.cpp @@ -43,7 +43,7 @@ namespace OHOS { p_TraingDanceListAdapter->AddItem(item); } - void TraingDanceView::InitView() + void TraingDanceView::InitView() { if (scrollView == nullptr) { @@ -51,8 +51,8 @@ namespace OHOS } scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(52); - // scrollView->SetReboundSize(100); + // scrollView->SetScrollBlankSize(52); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -61,7 +61,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1",STR_DANCING_TITLE, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_EXTREME_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + title->SetStyle(STYLE_TEXT_COLOR, Color::Green().full); scrollView->Add(title); // UIList 的适配器 p_TraingDanceListAdapter = new TraingDanceAdapter(); @@ -74,16 +75,17 @@ namespace OHOS TraingDanceList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingDanceList->SetScrollBlankSize(Dance_SCROLLBLANKSIZE); TraingDanceList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position + TraingDanceList->SetReboundSize(50); TraingDanceList->SetDraggable(true); - TraingDanceList->SetThrowDrag(false); + TraingDanceList->SetThrowDrag(true); TraingDanceList->EnableAutoAlign(true); TraingDanceList->SetElastic(true); // 设置回弹效果 TraingDanceList->SetMaxScrollDistance(MAX_SCR_DIS); TraingDanceList->SetYScrollBarVisible(true); // 设置滑动滚动条 // 增加表冠控制 - scrollView->SetRotateFactor(2); - scrollView->RequestFocus(); + TraingDanceList->SetRotateFactor(2); + TraingDanceList->RequestFocus(); } UIList *TraingDanceView::GetList() { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_fitness/src/TraingFitnessView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_fitness/src/TraingFitnessView.cpp index 5fce63ae1..987c56dfa 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_fitness/src/TraingFitnessView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_fitness/src/TraingFitnessView.cpp @@ -41,7 +41,7 @@ namespace OHOS { p_TraingFitnessListAdapter->AddItem(item); } - void TraingFitnessView::InitView() + void TraingFitnessView::InitView() { if (scrollView == nullptr) { @@ -49,8 +49,8 @@ namespace OHOS } scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(52); - // scrollView->SetReboundSize(100); + // scrollView->SetScrollBlankSize(52); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -59,7 +59,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1", STR_EXERCISE_TITLE, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_EXTREME_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + title->SetStyle(STYLE_TEXT_COLOR, Color::Green().full); scrollView->Add(title); // UIList 的适配器 p_TraingFitnessListAdapter = new TraingFitnessAdapter(); @@ -71,10 +72,10 @@ namespace OHOS TraingFitnessList->SetPosition(Fitness_LIST_POSITION_X, Fitness_LIST_POSITION_Y); TraingFitnessList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingFitnessList->SetScrollBlankSize(Fitness_SCROLLBLANKSIZE); - TraingFitnessList->SetReboundSize(50); TraingFitnessList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position + TraingFitnessList->SetReboundSize(50); TraingFitnessList->SetDraggable(true); - TraingFitnessList->SetThrowDrag(false); + TraingFitnessList->SetThrowDrag(true); TraingFitnessList->EnableAutoAlign(true); TraingFitnessList->SetElastic(true); // 设置回弹效果 TraingFitnessList->SetMaxScrollDistance(MAX_SCR_DIS); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp index b689951c9..e18e37541 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp @@ -59,8 +59,8 @@ namespace OHOS } scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(52); - // scrollView->SetReboundSize(100); + // scrollView->SetScrollBlankSize(52); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -69,7 +69,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1", STR_ICE_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_ICE_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + title->SetStyle(STYLE_TEXT_COLOR, Color::Green().full); scrollView->Add(title); // UIList 的适配器 p_TraingIceListAdapter = new TraingIceAdapter(); @@ -83,8 +84,9 @@ namespace OHOS TraingIceList->SetScrollBlankSize(Ice_SCROLLBLANKSIZE); TraingIceList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position TraingIceList->SetDraggable(true); - TraingIceList->SetThrowDrag(false); + TraingIceList->SetThrowDrag(true); TraingIceList->EnableAutoAlign(true); + TraingIceList->SetReboundSize(50); TraingIceList->SetElastic(true); // 设置回弹效果 TraingIceList->SetMaxScrollDistance(MAX_SCR_DIS); TraingIceList->SetYScrollBarVisible(true); // 设置滑动滚动条 diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitView.cpp index c7f6f2cdb..6aee62497 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitView.cpp @@ -51,8 +51,8 @@ namespace OHOS } scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(52); - // scrollView->SetReboundSize(100); + // scrollView->SetScrollBlankSize(52); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -61,7 +61,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1", STR_EXTREME_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_EXTREME_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + title->SetStyle(STYLE_TEXT_COLOR, Color::Green().full); scrollView->Add(title); // UIList 的适配器 p_TraingLimitListAdapter = new TraingLimitAdapter(); @@ -74,8 +75,9 @@ namespace OHOS TraingLimitList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingLimitList->SetScrollBlankSize(Limit_SCROLLBLANKSIZE); TraingLimitList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position + TraingLimitList->SetReboundSize(50); TraingLimitList->SetDraggable(true); - TraingLimitList->SetThrowDrag(false); + TraingLimitList->SetThrowDrag(true); TraingLimitList->EnableAutoAlign(true); TraingLimitList->SetElastic(true); // 设置回弹效果 TraingLimitList->SetMaxScrollDistance(MAX_SCR_DIS); diff --git 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 index de5a8df4b..049d89448 100644 --- 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 @@ -59,8 +59,8 @@ namespace OHOS } scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(52); - // scrollView->SetReboundSize(100); + // scrollView->SetScrollBlankSize(52); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -69,7 +69,7 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1", STR_TRAINING, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_TRAINING, DEFAULT_VECTOR_FONT_FILENAME, 30); scrollView->Add(title); // UIList 的适配器 p_TraingMoreListAdapter = new TraingMoreAdapter(); @@ -81,17 +81,19 @@ namespace OHOS TraingMoreList->SetPosition(More_LIST_POSITION_X, More_LIST_POSITION_Y); TraingMoreList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingMoreList->SetScrollBlankSize(More_SCROLLBLANKSIZE); + TraingMoreList->SetReboundSize(50); TraingMoreList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position TraingMoreList->SetDraggable(true); - TraingMoreList->SetThrowDrag(false); + TraingMoreList->SetThrowDrag(true); TraingMoreList->EnableAutoAlign(true); TraingMoreList->SetElastic(true); // 设置回弹效果 TraingMoreList->SetMaxScrollDistance(MAX_SCR_DIS); - TraingMoreList->SetYScrollBarVisible(true); // 设置滑动滚动条 + + scrollView->SetYScrollBarVisible(true); // 设置滑动滚动条 // 增加表冠控制 - scrollView->SetRotateFactor(2); - scrollView->RequestFocus(); + TraingMoreList->SetRotateFactor(2); + TraingMoreList->RequestFocus(); } UIList *TraingMoreView::GetList() { @@ -135,7 +137,6 @@ namespace OHOS void TraingMoreView::OnSetUpView() { View::OnSetUpView(); - // scrollView->Add(title); scrollView->Add(TraingMoreList); scrollView->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); RootView::GetInstance()->Add(scrollView); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_other/src/TraingOtherView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_other/src/TraingOtherView.cpp index 5e460dbda..935da9d23 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_other/src/TraingOtherView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_other/src/TraingOtherView.cpp @@ -43,7 +43,7 @@ namespace OHOS { p_TraingOtherListAdapter->AddItem(item); } - void TraingOtherView::InitView() + void TraingOtherView::InitView() { if (scrollView == nullptr) { @@ -51,8 +51,8 @@ namespace OHOS } scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - scrollView->SetScrollBlankSize(20); - // scrollView->SetReboundSize(100); + // scrollView->SetScrollBlankSize(52); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -61,7 +61,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1",STR_OTHER_TITLE, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_EXTREME_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + title->SetStyle(STYLE_TEXT_COLOR, Color::Green().full); scrollView->Add(title); // UIList 的适配器 p_TraingOtherListAdapter = new TraingOtherAdapter(); @@ -72,10 +73,11 @@ namespace OHOS } TraingOtherList->SetPosition(Other_LIST_POSITION_X, Other_LIST_POSITION_Y); TraingOtherList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); - // TraingOtherList->SetScrollBlankSize(Other_SCROLLBLANKSIZE); + TraingOtherList->SetScrollBlankSize(Other_SCROLLBLANKSIZE); TraingOtherList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position + TraingOtherList->SetReboundSize(50); TraingOtherList->SetDraggable(true); - TraingOtherList->SetThrowDrag(false); + TraingOtherList->SetThrowDrag(true); TraingOtherList->EnableAutoAlign(true); TraingOtherList->SetElastic(true); // 设置回弹效果 TraingOtherList->SetMaxScrollDistance(MAX_SCR_DIS); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_rest/src/TraingRestView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_rest/src/TraingRestView.cpp index 93354eef0..ae10b334c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_rest/src/TraingRestView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_rest/src/TraingRestView.cpp @@ -43,7 +43,7 @@ namespace OHOS { p_TraingRestListAdapter->AddItem(item); } - void TraingRestView::InitView() + void TraingRestView::InitView() { if (scrollView == nullptr) { @@ -52,7 +52,7 @@ namespace OHOS scrollView->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); // scrollView->SetScrollBlankSize(52); - // scrollView->SetReboundSize(100); + scrollView->SetReboundSize(50); scrollView->SetTouchable(true); scrollView->SetDraggable(true); scrollView->SetDirection(1); @@ -61,7 +61,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 初始化Lable - TraingModel::GetInstance()->InitLabelExt(title, 155, 52, 200, 60, "label1", STR_RECREATIONAL_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + TraingModel::GetInstance()->InitLabelExt(title, 125, 52, 200, 60, "label1", STR_EXTREME_LIST, DEFAULT_VECTOR_FONT_FILENAME, 30); + title->SetStyle(STYLE_TEXT_COLOR, Color::Green().full); scrollView->Add(title); // UIList 的适配器 p_TraingRestListAdapter = new TraingRestAdapter(); @@ -74,8 +75,9 @@ namespace OHOS TraingRestList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingRestList->SetScrollBlankSize(Rest_SCROLLBLANKSIZE); TraingRestList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position + TraingRestList->SetReboundSize(50); TraingRestList->SetDraggable(true); - TraingRestList->SetThrowDrag(false); + TraingRestList->SetThrowDrag(true); TraingRestList->EnableAutoAlign(true); TraingRestList->SetElastic(true); // 设置回弹效果 TraingRestList->SetMaxScrollDistance(MAX_SCR_DIS);