From d3a7f6df690cd06f7770a5175b4526327e6b0989 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Tue, 30 Jul 2024 19:52:11 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E8=AE=AD=E7=BB=83=E8=AE=B0?= =?utf8?q?=E5=BD=95Id=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/main/include/MainPresenterSample.h | 2 ++ .../nativeui/main/src/MainPresenterSample.cpp | 17 ++++++++++------- .../traingrecord/include/TraingRecordView.h | 2 +- .../traingrecord/src/TraingRecordView.cpp | 8 +++++--- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h index 7f3bb11d2..a815fde55 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h @@ -30,6 +30,8 @@ namespace OHOS static constexpr const char *MAIN_CLICK_ACTIVITY = "mainclickactivity"; static constexpr const char *MAIN_CLICK_MESSAGE = "mainclickmessage"; static constexpr const char *MAIN_CLICK_HEARTRATE = "mainclickheartrate"; + static constexpr const char *MAIN_CLICK_BLOOD = "mainclickblood"; // 血氧检测 + static constexpr const char *MAIN_CLICK_SETCARD = "mainclicksetcard"; // 设置卡片 static constexpr const char *DROPDOWN_CLICK_DONOTDISTURB = "dropdownclickdonotdisturb"; static constexpr const char *DROPDOWN_CLICK_BRIGHTENSCREEN = "dropdownclickbrightscreen"; diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp index 6698e3683..da7cec537 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp @@ -44,6 +44,8 @@ namespace OHOS {DROPDOWN_CLICK_DNOTDISTURB, VIEW_DNOTDISTURB}, // 勿扰 {DROPDOWN_CLICK_SAVEELE, VIEW_SAVEELE}, // 省电模式 {DROPDOWN_CLICK_FINDMYPHONE, VIEW_FIND_PHONE}, // 查找手机 + {MAIN_CLICK_BLOOD, VIEW_BLOODOXY_CHECK}, // 血氧检查 + {MAIN_CLICK_SETCARD, VIEW_ADD_CARD}, // 卡片管理 }; static MainPresenterSample *g_pMainPresenterSample = nullptr; @@ -154,11 +156,12 @@ namespace OHOS PullUpDown_StartTimer(1000); // 切回下拉控制中心视图开启定时器 return true; } - // if(&view == PullUpDownView::GetInstance()->GetConnectedStatusView()->GetCloseButton()) - // { - // PullUpDownView::GetInstance()->ChangeView(CONNECTEDSTATUSVIEW,DROPDOWNVIEW); - // return true; - // } + // 设置血氧进入 + else if (curViewId == MAIN_CLICK_BLOOD) + { + MainModel::GetInstance().SetFromSetCardView(true); + MainModel::GetInstance().SetFromCardId(BLOODOXGEN); + } // 如果勿扰模式是开启状态,在下拉界面点击勿扰快捷入口会关闭勿扰模式不进入勿扰视图 if (g_jumpView[curViewId] == VIEW_DNOTDISTURB && DnotDisturbModel::GetInstance().GetDoNotDisturbModeEnabled() == true) @@ -170,7 +173,6 @@ namespace OHOS if (g_jumpView.count(curViewId) != 0) { - // NativeAbility::GetInstance().ChangeSlice(g_jumpView[curViewId]); NativeAbility::GetInstance().EnterSlice(g_jumpView[curViewId]); } return true; @@ -394,7 +396,8 @@ namespace OHOS } break; case WEATHER: - if(WeatherModel::GetInstance().GetWeatherDataIsValid()) { + if (WeatherModel::GetInstance().GetWeatherDataIsValid()) + { WeatherModel::GetInstance().UpdateWeatherCurTime(); } break; diff --git a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h index c3cd229eb..cdf47dc73 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h @@ -1,7 +1,7 @@ /*** * @Date: 2024-05-20 19:40:41 * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-07-06 16:38:46 + * @LastEditTime: 2024-07-27 17:47:13 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h */ /*** 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 5363fc6b0..b70bba69c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp @@ -148,12 +148,12 @@ namespace OHOS lackView->SetReboundSize(50); lackView->SetDirection(1); /*初始化label*/ - InitLabelExt(labeltitle_, 83, 50, 300, 35, "labletitle", STR_TRAINGNO, DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabelExt(labelrecord_, 53, 260, 360, 40, "labelrecord", STR_TRAINGGO, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitLabelExt(labeltitle_, 83, 50, 300, 35, "labletitle", STR_TRAINING_RECORD, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitLabelExt(labelrecord_, 53, 260, 360, 40, "labelrecord", STR_TRAINGNO, DEFAULT_VECTOR_FONT_FILENAME, 30); /*初始化image*/ InitImageView(imagerecord, 174, 120, 118, 120, "image", RECOED_IMAGE); /*初始化按键*/ - InitButtonExt(buttongo, 93, 330, 280, 90, BUTTONGO, STR_TRAINING, 26); + InitButtonExt(buttongo, 93, 330, 280, 90, BUTTONGO, STR_TRAINGGO, 30); buttongo->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); // 设置按键颜色 buttongo->SetOnClickListener(static_cast(TraingRecordPresenter::GetInstance())); @@ -252,6 +252,8 @@ namespace OHOS // 获取目前的view void TraingRecordView::OnStart() { + View::OnStart(); + container_ = new UIScrollView(); if (container_ == nullptr) { -- 2.17.1