From 66720f43b9e2369a2e65692929fb7ad05fe5ff7c Mon Sep 17 00:00:00 2001 From: Caisking Date: Sat, 21 Jun 2025 16:40:15 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E8=BF=90=E5=8A=A8=E8=BF=87?= =?utf8?q?=E7=A8=8B=E4=B8=ADgps=E4=B8=A2=E5=A4=B1=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/applist/src/ApplistModel.cpp | 2 +- .../training_card/include/TraingCardView.h | 11 +++++ .../training_card/src/TraingCardView.cpp | 49 +++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp index 46065629a..2be36bea9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp @@ -71,7 +71,7 @@ namespace OHOS //ECG {VIEW_ECG, PNG_APPLIST_ECG_IMAGE_BIG, PNG_APPLIST_ECG_IMAGE, PNG_APPLIST_DEFAULT_IMG, "ECG", STR_BP_CHECK, nullptr}, //情绪 - {VIEW_EMOTION, PNG_APPLIST_EMOTION_IMAGE_BIG, PNG_APPLIST_EMOTION_IMAGE, PNG_APPLIST_DEFAULT_IMG, "情绪", STR_EMOTION, nullptr}, + // {VIEW_EMOTION, PNG_APPLIST_EMOTION_IMAGE_BIG, PNG_APPLIST_EMOTION_IMAGE, PNG_APPLIST_DEFAULT_IMG, "情绪", STR_EMOTION, nullptr}, //压力 //{VIEW_STRESS, PNG_APPLIST_STRESS_IMAGE_BIG, PNG_APPLIST_STRESS_IMAGE, PNG_APPLIST_DEFAULT_IMG, "压力", STR_STRESS, nullptr}, //疲劳度 diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/include/TraingCardView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/include/TraingCardView.h index 8c8d773e7..f738530fa 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/include/TraingCardView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/include/TraingCardView.h @@ -82,6 +82,7 @@ namespace OHOS UICardPage *InitDataPage(void); UICardPage *InitMusicPage(void); + UICardPage *InitDetailPage(void); void InitView(); @@ -90,9 +91,12 @@ namespace OHOS void PreLoad(void); void InitImageAnimator(); + void ShowGetTagView(); void ShowEndView(); void ShowHeartView(); + void ShowGPSView(); + bool RefreshEndView(); UICrossView *GetTraingCrad(); int GetCurrentPage(); @@ -110,6 +114,7 @@ namespace OHOS UIScrollView *endView{nullptr}; UIScrollView *getView{nullptr}; UIScrollView *heartView{nullptr}; + UIScrollView *gpsView{nullptr}; TrainingControlView *controlview_{nullptr}; // 控制卡片 TraingDataAllView *dataallview_{nullptr}; // 数据卡片 TrainingDetailView *DetailView{nullptr}; // 详细数据卡片 @@ -137,6 +142,12 @@ namespace OHOS UIImageView *heartiamge = nullptr; UILabelButtonExt *buttonnote_ = nullptr; + /*GPS弹窗*/ + UILabelExt *gpstitle = nullptr; + UILabelExt *gpsnote = nullptr; + UIImageView *gpsiamge = nullptr; + UILabelButtonExt *gpsbuttonnote_ = nullptr; + bool viewiInitStatus{false}; bool momentumFlag{false}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp index ca2ebc08b..05cbf93cb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp @@ -658,6 +658,17 @@ void TraingCardView::DeInit() { hearttitle = nullptr; delete labelnote; labelnote = nullptr; + + delete gpstitle; + gpstitle = nullptr; + delete gpsnote; + gpsnote = nullptr; + delete gpsiamge; + gpsiamge = nullptr; + delete gpsbuttonnote_; + gpsbuttonnote_ = nullptr; + + /*图片*/ delete heartiamge; heartiamge = nullptr; @@ -686,6 +697,8 @@ void TraingCardView::DeInit() { dataallview_ = nullptr; delete musicview_; musicview_ = nullptr; + delete gpsView; + gpsView = nullptr; delete DetailView; //删除屏蔽卡片 DetailView = nullptr; @@ -937,6 +950,42 @@ void TraingCardView::ShowHeartView() { heartView->SetVisible(false); // 界面隐藏 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShowHeartView end"); } +void TraingCardView::ShowGPSView() { + gpsView = new UIScrollView(); + if (gpsView == nullptr) { + return; + } + gpsView->SetPosition(0, 0); + gpsView->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION); + gpsView->SetScrollBlankSize(20); + gpsView->SetReboundSize(50); + gpsView->SetDirection(1); + + // 初始化Lable 根据gps状态显示 + InitLabel(gpstitle, 83, 50, 300, 35, "label1", "GPS丢失", + DEFAULT_VECTOR_FONT_FILENAME, 35); + gpsView->Add(gpstitle); + + InitLabel(gpsnote, 53, 269, 360, 35, "label3", "当前位置搜索不到GPS信号", + DEFAULT_VECTOR_FONT_FILENAME_EN, 30); + gpsnote->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + gpsnote->SetRollSpeed(23); + gpsView->Add(gpsnote); + + InitImageView(gpsiamge, 193, 140, 80, 80, "note", WARNING_IMAGE); + gpsView->Add(gpsiamge); + + InitButtonExt(gpsbuttonnote_, 0, 366, 466, 100, BUTTONNOTE, STR_OK, 30); + gpsbuttonnote_->SetImageSrc(BUTTONOK_IMAGE, BUTTONOK_IMAGE); + gpsbuttonnote_->SetOnClickListener(static_cast( + TraingCardPresenter::GetInstance())); + gpsView->Add(gpsbuttonnote_); + + RootView::GetInstance()->Add(gpsView); + gpsView->SetDraggable(false); + gpsView->SetTouchable(true); + gpsView->SetVisible(false); // 界面隐藏 +} /*获取运动量结束弹窗界面刷新*/ bool TraingCardView::RefreshEndView() { // 获取训练卡路里判断运动量 -- 2.17.1