From: Caisking <3449750381@qq.com> Date: Thu, 18 Apr 2024 08:01:30 +0000 (+0800) Subject: 优化目标设置界面交互 X-Git-Tag: release_V1.2.70_20241020_135402~1171^2~6 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c3ce846294dc6737f049f80f6311a93c6f5e9059;p=mirrors%2FFD230.git 优化目标设置界面交互 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetView.h index 8375af46a..8afcd2de7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingSetView.h @@ -63,6 +63,14 @@ namespace OHOS bool ChangeSetDurationView(int16_t thisview); bool ClickFunc(int16_t interface); void ChangeView(int16_t hideView, int16_t showView); + void SetCurrentViewId(int viewId) + { + CurrentViewId = viewId; + } + int GetCurrentViewId() + { + return CurrentViewId; + } private: UIView::OnDragListener *draglistener{nullptr}; @@ -99,6 +107,7 @@ namespace OHOS UIButton *butSteps = nullptr; bool viewiInitStatus{false}; + int CurrentViewId; }; } // namespace OHOS #endif // TraingSet_PRESENTER_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetPresenter.cpp index 0de53bd93..ecdefd021 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetPresenter.cpp @@ -70,10 +70,18 @@ namespace OHOS bool TraingSetPresenter::OnDragEnd(UIView &view, const DragEvent &event) { - + int CardID = TraingSetView::GetInstance()->GetCurrentViewId(); if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { - NativeAbility::GetInstance().Back(); + // 不在设置页面 + if (CardID != SET_VIEW) + { + TraingSetView::GetInstance()->ChangeView(CardID, SET_VIEW); + } + else + { + NativeAbility::GetInstance().Back(); + } } UNUSED(view); return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp index 7894824f4..515fadbaa 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp @@ -333,6 +333,7 @@ namespace OHOS SetTagScrollView[hideView]->SetVisible(false); ClickFunc(showView); SetTagScrollView[showView]->SetVisible(true); + SetCurrentViewId(showView); // 切换页面更换成目标ID Draw(); } /* -------------------------------------------------------------------------- */ @@ -369,6 +370,7 @@ namespace OHOS PreLoad(); RootView::GetInstance()->Add(SetTagScrollView[SET_VIEW]); + SetCurrentViewId(SET_VIEW); // 设置当前页面ID } void TraingSetView::OnSetUpView()