From fdb2a2ff31afc46cf99b189b2b7be51e57503bfe Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Wed, 31 Jul 2024 17:49:35 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E8=AE=AD=E7=BB=83=E5=88=97?= =?utf8?q?=E8=A1=A8=E5=8D=A1=E6=AD=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../training_list_ball/src/TraingBallView.cpp | 12 ++- .../src/TraingDanceView.cpp | 12 ++- .../src/TraingFitnessView.cpp | 12 ++- .../training_list_ice/src/TraingIceView.cpp | 11 ++- .../src/TraingLimitView.cpp | 11 ++- .../training_list_more/src/TraingMoreView.cpp | 27 +++--- .../src/TraingOtherView.cpp | 11 ++- .../training_list_rest/src/TraingRestView.cpp | 11 ++- .../traingrecord/src/TraingRecordView.cpp | 85 ++++++------------- 9 files changed, 114 insertions(+), 78 deletions(-) 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 3d2b07a80..9d0ac0861 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 @@ -79,6 +79,7 @@ namespace OHOS { TraingBallList = new UIList(); } +#if 0 TraingBallList->SetPosition(Ball_LIST_POSITION_X, Ball_LIST_POSITION_Y); TraingBallList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingBallList->SetScrollBlankSize(Ball_SCROLLBLANKSIZE); @@ -90,6 +91,14 @@ namespace OHOS TraingBallList->SetElastic(true); // 设置回弹效果 TraingBallList->SetMaxScrollDistance(MAX_SCR_DIS); TraingBallList->SetYScrollBarVisible(true); // 设置滑动滚动条 +#endif + + TraingBallList->SetPosition(Ball_LIST_POSITION_X, Ball_LIST_POSITION_Y, 466, 466); + TraingBallList->SetThrowDrag(true); + TraingBallList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + TraingBallList->SetMaxScrollDistance(1000); + TraingBallList->SetSwipeACCLevel(800); + TraingBallList->SetDragACCLevel(5); // 增加表冠控制 TraingBallList->SetRotateFactor(2); @@ -160,9 +169,8 @@ namespace OHOS { View::OnStop(); - RootView::GetInstance()->ClearOnKeyActListener(); - //FocusManager::GetInstance()->ClearFocus(); + // FocusManager::GetInstance()->ClearFocus(); RootView::GetInstance()->RemoveAll(); // RootView::GetInstance()->ClearFocus(); return; 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 25eec3a76..3e44f6919 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 @@ -79,6 +79,7 @@ namespace OHOS { TraingDanceList = new UIList(); } +#if 0 TraingDanceList->SetPosition(Dance_LIST_POSITION_X, Dance_LIST_POSITION_Y); TraingDanceList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingDanceList->SetScrollBlankSize(Dance_SCROLLBLANKSIZE); @@ -90,6 +91,14 @@ namespace OHOS TraingDanceList->SetElastic(true); // 设置回弹效果 TraingDanceList->SetMaxScrollDistance(MAX_SCR_DIS); TraingDanceList->SetYScrollBarVisible(true); // 设置滑动滚动条 +#endif + + TraingDanceList->SetPosition(Dance_LIST_POSITION_X, Dance_LIST_POSITION_Y, 466, 466); + TraingDanceList->SetThrowDrag(true); + TraingDanceList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + TraingDanceList->SetMaxScrollDistance(1000); + TraingDanceList->SetSwipeACCLevel(800); + TraingDanceList->SetDragACCLevel(5); // 增加表冠控制 TraingDanceList->SetRotateFactor(2); @@ -160,9 +169,8 @@ namespace OHOS { View::OnStop(); - RootView::GetInstance()->ClearOnKeyActListener(); - //FocusManager::GetInstance()->ClearFocus(); + // FocusManager::GetInstance()->ClearFocus(); RootView::GetInstance()->RemoveAll(); // RootView::GetInstance()->ClearFocus(); return; 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 e7daa0445..0f9e83170 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 @@ -78,6 +78,7 @@ namespace OHOS { TraingFitnessList = new UIList(); } +#if 0 TraingFitnessList->SetPosition(Fitness_LIST_POSITION_X, Fitness_LIST_POSITION_Y); TraingFitnessList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingFitnessList->SetScrollBlankSize(Fitness_SCROLLBLANKSIZE); @@ -89,6 +90,14 @@ namespace OHOS TraingFitnessList->SetElastic(true); // 设置回弹效果 TraingFitnessList->SetMaxScrollDistance(MAX_SCR_DIS); TraingFitnessList->SetYScrollBarVisible(true); // 设置滑动滚动条 +#endif + + TraingFitnessList->SetPosition(Fitness_LIST_POSITION_X, Fitness_LIST_POSITION_Y, 466, 466); + TraingFitnessList->SetThrowDrag(true); + TraingFitnessList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + TraingFitnessList->SetMaxScrollDistance(1000); + TraingFitnessList->SetSwipeACCLevel(800); + TraingFitnessList->SetDragACCLevel(5); // 增加表冠控制 TraingFitnessList->SetRotateFactor(2); @@ -164,9 +173,8 @@ namespace OHOS { View::OnStop(); - RootView::GetInstance()->ClearOnKeyActListener(); - //FocusManager::GetInstance()->ClearFocus(); + // FocusManager::GetInstance()->ClearFocus(); RootView::GetInstance()->RemoveAll(); // RootView::GetInstance()->ClearFocus(); return; 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 295fa7a6e..a2fb057ec 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 @@ -87,6 +87,7 @@ namespace OHOS { TraingIceList = new UIList(); } +#if 0 TraingIceList->SetPosition(Ice_LIST_POSITION_X, Ice_LIST_POSITION_Y); TraingIceList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingIceList->SetScrollBlankSize(Ice_SCROLLBLANKSIZE); @@ -98,6 +99,14 @@ namespace OHOS TraingIceList->SetElastic(true); // 设置回弹效果 TraingIceList->SetMaxScrollDistance(MAX_SCR_DIS); TraingIceList->SetYScrollBarVisible(true); // 设置滑动滚动条 +#endif + + TraingIceList->SetPosition(Ice_LIST_POSITION_X, Ice_LIST_POSITION_Y, 466, 466); + TraingIceList->SetThrowDrag(true); + TraingIceList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + TraingIceList->SetMaxScrollDistance(1000); + TraingIceList->SetSwipeACCLevel(800); + TraingIceList->SetDragACCLevel(5); // 增加表冠控制 scrollView->SetRotateFactor(2); @@ -169,7 +178,7 @@ namespace OHOS View::OnStop(); RootView::GetInstance()->ClearOnKeyActListener(); - //FocusManager::GetInstance()->ClearFocus(); + // FocusManager::GetInstance()->ClearFocus(); RootView::GetInstance()->RemoveAll(); // RootView::GetInstance()->ClearFocus(); return; 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 4ff500372..415ee6479 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 @@ -80,6 +80,7 @@ namespace OHOS { TraingLimitList = new UIList(); } +#if 0 TraingLimitList->SetPosition(Limit_LIST_POSITION_X, Limit_LIST_POSITION_Y); TraingLimitList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingLimitList->SetScrollBlankSize(Limit_SCROLLBLANKSIZE); @@ -91,6 +92,14 @@ namespace OHOS TraingLimitList->SetElastic(true); // 设置回弹效果 TraingLimitList->SetMaxScrollDistance(MAX_SCR_DIS); TraingLimitList->SetYScrollBarVisible(true); // 设置滑动滚动条 +#endif + + TraingLimitList->SetPosition(Limit_LIST_POSITION_X, Limit_LIST_POSITION_Y, 466, 466); + TraingLimitList->SetThrowDrag(true); + TraingLimitList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + TraingLimitList->SetMaxScrollDistance(1000); + TraingLimitList->SetSwipeACCLevel(800); + TraingLimitList->SetDragACCLevel(5); // 增加表冠控制 TraingLimitList->SetRotateFactor(2); @@ -162,7 +171,7 @@ namespace OHOS View::OnStop(); RootView::GetInstance()->ClearOnKeyActListener(); - //FocusManager::GetInstance()->ClearFocus(); + // FocusManager::GetInstance()->ClearFocus(); RootView::GetInstance()->RemoveAll(); // RootView::GetInstance()->ClearFocus(); return; 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 e6d283b65..8e661f554 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 @@ -83,16 +83,22 @@ namespace OHOS { TraingMoreList = new UIList(); } - 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->SetScrollBlankSize(More_SCROLLBLANKSIZE); + // TraingMoreList->SetReboundSize(50); + // TraingMoreList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position + // TraingMoreList->SetDraggable(true); + // TraingMoreList->SetThrowDrag(true); + // TraingMoreList->EnableAutoAlign(true); + // TraingMoreList->SetElastic(true); // 设置回弹效果 + // TraingMoreList->SetMaxScrollDistance(MAX_SCR_DIS); + + TraingMoreList->SetPosition(More_LIST_POSITION_X, More_LIST_POSITION_Y, 466, 466); TraingMoreList->SetThrowDrag(true); - TraingMoreList->EnableAutoAlign(true); - TraingMoreList->SetElastic(true); // 设置回弹效果 - TraingMoreList->SetMaxScrollDistance(MAX_SCR_DIS); + TraingMoreList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + TraingMoreList->SetMaxScrollDistance(1000); + TraingMoreList->SetSwipeACCLevel(800); + TraingMoreList->SetDragACCLevel(5); scrollView->SetYScrollBarVisible(true); // 设置滑动滚动条 @@ -165,9 +171,8 @@ namespace OHOS { View::OnStop(); - RootView::GetInstance()->ClearOnKeyActListener(); - //FocusManager::GetInstance()->ClearFocus(); + // FocusManager::GetInstance()->ClearFocus(); RootView::GetInstance()->RemoveAll(); // RootView::GetInstance()->ClearFocus(); return; 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 5d02e5f3b..7e2b2118f 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 @@ -80,6 +80,7 @@ namespace OHOS { TraingOtherList = new UIList(); } +#if 0 TraingOtherList->SetPosition(Other_LIST_POSITION_X, Other_LIST_POSITION_Y); TraingOtherList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingOtherList->SetScrollBlankSize(Other_SCROLLBLANKSIZE); @@ -91,6 +92,14 @@ namespace OHOS TraingOtherList->SetElastic(true); // 设置回弹效果 TraingOtherList->SetMaxScrollDistance(MAX_SCR_DIS); TraingOtherList->SetYScrollBarVisible(true); // 设置滑动滚动条 +#endif + + TraingOtherList->SetPosition(Other_LIST_POSITION_X, Other_LIST_POSITION_Y, 466, 466); + TraingOtherList->SetThrowDrag(true); + TraingOtherList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + TraingOtherList->SetMaxScrollDistance(1000); + TraingOtherList->SetSwipeACCLevel(800); + TraingOtherList->SetDragACCLevel(5); // 增加表冠控制 TraingOtherList->SetRotateFactor(2); @@ -162,7 +171,7 @@ namespace OHOS View::OnStop(); RootView::GetInstance()->ClearOnKeyActListener(); - //FocusManager::GetInstance()->ClearFocus(); + // FocusManager::GetInstance()->ClearFocus(); RootView::GetInstance()->RemoveAll(); // RootView::GetInstance()->ClearFocus(); return; 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 349a0ed38..149c7ec36 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 @@ -80,6 +80,7 @@ namespace OHOS { TraingRestList = new UIList(); } +#if 0 TraingRestList->SetPosition(Rest_LIST_POSITION_X, Rest_LIST_POSITION_Y); TraingRestList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); TraingRestList->SetScrollBlankSize(Rest_SCROLLBLANKSIZE); @@ -91,6 +92,14 @@ namespace OHOS TraingRestList->SetElastic(true); // 设置回弹效果 TraingRestList->SetMaxScrollDistance(MAX_SCR_DIS); TraingRestList->SetYScrollBarVisible(true); // 设置滑动滚动条 +#endif + + TraingRestList->SetPosition(Rest_LIST_POSITION_X, Rest_LIST_POSITION_Y, 466, 466); + TraingRestList->SetThrowDrag(true); + TraingRestList->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + TraingRestList->SetMaxScrollDistance(1000); + TraingRestList->SetSwipeACCLevel(800); + TraingRestList->SetDragACCLevel(5); // 增加表冠控制 TraingRestList->SetRotateFactor(2); @@ -162,7 +171,7 @@ namespace OHOS View::OnStop(); RootView::GetInstance()->ClearOnKeyActListener(); - //FocusManager::GetInstance()->ClearFocus(); + // FocusManager::GetInstance()->ClearFocus(); RootView::GetInstance()->RemoveAll(); // RootView::GetInstance()->ClearFocus(); return; 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 b70bba69c..b91e8da50 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp @@ -63,68 +63,33 @@ namespace OHOS /* DeInit:删除组件 */ void TraingRecordView::DeInit() { - container_->RemoveAll(); lackView->RemoveAll(); recordView->RemoveAll(); - TraingRecordList->RemoveAll(); - if (labeltitle_ != nullptr) - { - lackView->Remove(labeltitle_); - delete labeltitle_; - labeltitle_ = nullptr; - } - if (labelrecord_ != nullptr) - { - lackView->Remove(labelrecord_); - delete labelrecord_; - labelrecord_ = nullptr; - } - if (buttongo != nullptr) - { - lackView->Remove(buttongo); - delete buttongo; - buttongo = nullptr; - } - if (imagerecord != nullptr) - { - lackView->Remove(imagerecord); - delete imagerecord; - imagerecord = nullptr; - } - if (lackView != nullptr) - { - lackView->RemoveAll(); - delete lackView; - lackView = nullptr; - } + delete labeltitle_; + labeltitle_ = nullptr; - if (TraingRecordList != nullptr) - { - recordView->Remove(TraingRecordList); - delete TraingRecordList; - TraingRecordList = nullptr; - } - if (labelercord_ != nullptr) - { - recordView->Remove(labelercord_); - delete labelercord_; - labelercord_ = nullptr; - } - if (recordView != nullptr) - { - recordView->RemoveAll(); - delete recordView; - recordView = nullptr; - } - if (container_ != nullptr) - { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } - } + delete labelrecord_; + labelrecord_ = nullptr; + + delete buttongo; + buttongo = nullptr; + + delete imagerecord; + imagerecord = nullptr; + + delete lackView; + lackView = nullptr; + + delete TraingRecordList; + TraingRecordList = nullptr; + delete labelercord_; + labelercord_ = nullptr; + + delete recordView; + recordView = nullptr; + } void TraingRecordView::PreLoad(void) { if (!viewiInitStatus) @@ -308,6 +273,12 @@ namespace OHOS void TraingRecordView::OnStop() { View::OnStop(); + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } RootView::GetInstance()->RemoveAll(); return; } -- 2.17.1