From: Caisking Date: Fri, 8 Dec 2023 03:57:57 +0000 (+0800) Subject: 优化下拉界面组件;增加室内步行,体温监测power键适配 X-Git-Tag: release_V1.2.70_20241020_135402~1415 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=21fa3852d6ac8035d13dec469dd1ee18d679a329;p=mirrors%2FFD230.git 优化下拉界面组件;增加室内步行,体温监测power键适配 --- diff --git a/.vscode/settings.json b/.vscode/settings.json index 27f2cfdf9..fc174e1fd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "files.associations": { - "ios": "cpp" + "ios": "cpp", + "iterator": "cpp", + "bitset": "cpp", + "string_view": "cpp" } } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp index 5a08a4230..d703f44d5 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmNewTimeView.cpp @@ -152,6 +152,10 @@ UIScrollView *AlarmNewTimeView::InitNewTimeView(void) UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::AlarmPresenter::GetInstance(); labelButton->SetOnClickListener(clickListener); group->Add(labelButton); + + //增加按键监听 + RootView::OnKeyActListener*keyactListener = (RootView::OnKeyActListener*)OHOS::AlarmPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); UIView::OnDragListener *newTimeDragListener = (UIView::OnDragListener *)OHOS::AlarmPresenter::GetInstance(); if (newTimeDragListener == nullptr) { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp index 8dc65cb27..e0e157403 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmPresenter.cpp @@ -455,8 +455,7 @@ bool AlarmPresenter::OnKeyAct(UIView& view, const KeyEvent& event) } #endif //目前只有一个按键。直接切换 - uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); - NativeAbility::GetInstance().ChangeSlice(preSlice); + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); return true; } bool AlarmStatusBtnChangeListener::OnChange(UICheckBox::UICheckBoxState state) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp index 63bf6c3d6..3f4ce5229 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetTimeView.cpp @@ -150,6 +150,9 @@ UIScrollView *AlarmSetTimeView::InitSetTimeView(void) group->SetTouchable(true); group->SetDraggable(true); + //增加按键监听 + RootView::OnKeyActListener*keyactListener = (RootView::OnKeyActListener*)OHOS::AlarmPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); UIView::OnDragListener *setTimeDragListener = (UIView::OnDragListener *)OHOS::AlarmPresenter::GetInstance(); if (setTimeDragListener == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetTimeView:: setTimeDragListener is NULL"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp index 281aa192e..742d33be0 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/AlarmSetWeekView.cpp @@ -265,6 +265,9 @@ UIScrollView *AlarmSetWeekView::InitSetWeekView() group->SetTouchable(true); group->SetDraggable(true); + //增加按键监听 + RootView::OnKeyActListener*keyactListener = (RootView::OnKeyActListener*)OHOS::AlarmPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); UIView::OnDragListener *setWeekDragListener = (UIView::OnDragListener *)OHOS::AlarmPresenter::GetInstance(); if (setWeekDragListener == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new setWeekDragListener fail"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp index 64d76d139..7afe988f0 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/alarm/src/MainAlarmView.cpp @@ -455,6 +455,8 @@ bool MainAlarmView::ChangeMaxClock(int16_t thisView) void MainAlarmView::DropView(UIView& view) { + printf("into DropView!\n"); + if (&view == container[CHANGE_INTERFACE_CONFIG]) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainAlarmView::DropView::container[CHANGE_INTERFACE_CONFIG]"); ChangeView(CHANGE_INTERFACE_CONFIG, MAIN_INTERFACE); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp index 45b47ee81..e4c40be1b 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/src/ApplistModel.cpp @@ -21,13 +21,13 @@ namespace OHOS { const AppItem g_nativeAppList[] = { {VIEW_MAIN_ALARM, PNG_APPLIST_ALARM_IMAGE, PNG_APPLIST_ALARM_IMAGE, "闹钟", nullptr}, {VIEW_BLOODOXY_SAMPLE, PNG_APPLIST_SPO2_IMAGE, PNG_APPLIST_SPO2_IMAGE, "血氧饱和度", nullptr}, - {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "设置", nullptr}, - {VIEW_CALLER_SAMPLE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, "通话记录", nullptr}, + //{VIEW_CALLER_SAMPLE, PNG_APPLIST_CALLER_IMAGE, PNG_APPLIST_CALLER_IMAGE, "通话记录", nullptr}, {VIEW_COMPASS, PNG_APPLIST_COMPASS_IMAGE, PNG_APPLIST_COMPASS_IMAGE, "指南针", nullptr}, {VIEW_OFFLINEVOICE, PNG_APPLIST_VOCASSIST_IMAGE, PNG_APPLIST_VOCASSIST_IMAGE, "语音助手", nullptr}, {VIEW_MAIN_TEMP, PNG_APPLIST_TEMP_IMAGE, PNG_APPLIST_TEMP_IMAGE, "体温", nullptr}, {VIEW_INDOORWALK, PNG_APPLIST_WALK_IMAGE, PNG_APPLIST_WALK_IMAGE, "室内步行", nullptr}, {VIEW_UISAMPLE, PNG_APPLIST_UI_SAMPLE_IMAGE, PNG_APPLIST_UI_SAMPLE_IMAGE, "示例", nullptr}, + {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "设置", nullptr}, }; ApplistModel &ApplistModel::GetInstance(void) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp index 7fc04345f..fc125f0b8 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/src/BloodOxygenPresenter.cpp @@ -99,6 +99,7 @@ bool BloodOxygenPresenter::OnClick(UIView& view, const ClickEvent& event) //增加按键事件 bool BloodOxygenPresenter::OnKeyAct(UIView& view, const KeyEvent& event) { + printf("into the view is: %s\n", typeid(view).name()); uint16 keyID = event.GetKeyId(); printf("into key!\n"); #if 0 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h index ceee8ad07..f311a8dc7 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/include/IndoorWalkPresenter.h @@ -12,6 +12,8 @@ #include "NativeLauncher.h" #include "NativeAbility.h" #include "components/ui_swipe_view.h" +#include "KeyInputListener.h" +#include "common/key_code.h" namespace OHOS { @@ -61,7 +63,7 @@ static constexpr const char *SPEED_BUTTON = "speedView"; // 速度 static constexpr const char *STEPS_BUTTON = "stepsView"; // 步数 class IndoorWalkView; -class IndoorWalkPresenter : public Presenter, public UISwipeView::OnSwipeListener, +class IndoorWalkPresenter : public Presenter, public UISwipeView::OnSwipeListener,public RootView::OnKeyActListener, public UIView::OnClickListener, public UIView::OnLongPressListener, public UIView::OnDragListener { public: @@ -74,6 +76,7 @@ public: void OnStop() override; bool OnClick(UIView& view, const ClickEvent& event) override; bool OnDrag(UIView& view, const DragEvent& event) override; + bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件 bool OnLongPress(UIView& view, const LongPressEvent& event) override; virtual void OnSwipe(UISwipeView& view) override; void HidePageImageView(void); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp index 891a007b8..d45010c18 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/CustomizationView.cpp @@ -364,6 +364,10 @@ UIViewGroup *CustomizationView::InitPropertiesView() group->Add(speedView); group->Add(stepsView); + // 增加按键监听 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::IndoorWalkPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); + UIView::OnDragListener *dragListener = (UIView::OnDragListener *)OHOS::IndoorWalkPresenter::GetInstance(); if (dragListener == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "dragListener GetInstance fail"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp index 2f8b4c71d..55a3df4a7 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkEndView.cpp @@ -114,6 +114,9 @@ UIViewGroup *IndoorWalkEndView::InitShowUpView() } group->Add(cancelButton); group->Add(confirmButton); + // 增加按键监听 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::IndoorWalkPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); UIView::OnDragListener *indoorWalkDragListener = (UIView::OnDragListener *)OHOS::IndoorWalkPresenter::GetInstance(); if (indoorWalkDragListener == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "indoorWalkDragListener GetInstance fail"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp index fc49b8fdf..b78fb2e1d 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPreparedView.cpp @@ -256,8 +256,12 @@ UIViewGroup *IndoorWalkPreparedView::InitShowUpView() } ret = InitLableVIew(); if (ret == false) { - return nullptr; + return + nullptr; } + // 增加按键监听 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::IndoorWalkPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); UIView::OnDragListener *indoorWalkDragListener = (UIView::OnDragListener *)OHOS::IndoorWalkPresenter::GetInstance(); if (indoorWalkDragListener == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "indoorWalkDragListener GetInstance fail"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp index 02519ca4a..a3eedab22 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/indoorwalk/src/IndoorWalkPresenter.cpp @@ -273,6 +273,25 @@ bool IndoorWalkPresenter::OnDrag(UIView& view, const DragEvent& event) return true; } +// 增加按键事件 +bool IndoorWalkPresenter::OnKeyAct(UIView &view, const KeyEvent &event) +{ + uint16 keyID = event.GetKeyId(); + printf("into key!\n"); +#if 0 + //如果是power键就返回上一级 + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) + { + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); + } +#endif + // 目前只有一个按键。直接切换 + uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(preSlice); + return true; +} + struct IndoorWalkLongPressMapper { const char *viewId; void (IndoorWalkPresenter::*Getfunc)(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h index d0ce3ac36..5df6a40f1 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h @@ -33,6 +33,7 @@ static constexpr const char *MAIN_CLICK_HEARTRATE = "mainclickheartrate"; static constexpr const char *DROPDOWN_CLICK_DONOTDISTURB = "dropdownclickdonotdisturb"; static constexpr const char *DROPDOWN_CLICK_BRIGHTENSCREEN = "dropdownclickbrightscreen"; static constexpr const char *DROPDOWN_CLICK_FINDMYPHONE = "dropdownclickfindmyphone"; +static constexpr const char *DROPDOWN_CLICK_APPLIST = "dropdownclickfindmyphone"; static constexpr const char *DROPDOWN_CLICK_ALARM = "dropdownclickalarm"; static constexpr const char *DROPDOWN_CLICK_SETTING = "dropdownclicksetting"; constexpr uint16_t VERTICAL_STATUS = 1; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp index afe856c96..6e02bea2c 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainPresenterSample.cpp @@ -28,9 +28,11 @@ map g_jumpView = { { MAIN_CLICK_WEATHER, VIEW_MAIN_SAMPLE }, { MAIN_CLICK_MESSAGE, VIEW_MAIN_SAMPLE }, // 消息app { MAIN_CLICK_HEARTRATE, VIEW_MAIN_SAMPLE }, // 心率界面 { DROPDOWN_CLICK_ALARM, VIEW_MAIN_ALARM }, // 闹钟app - { DROPDOWN_CLICK_SETTING, VIEW_SETTING } }; // 设置界面 + { DROPDOWN_CLICK_APPLIST,VIEW_APPLIST }, //应用列表 + { DROPDOWN_CLICK_SETTING, VIEW_SETTING } }; // 设置界面 -map g_chanColor = { { DROPDOWN_CLICK_FINDMYPHONE, DROPDOWN_DROPDOWN_FIND_PHONE_B }, +map g_chanColor = { { DROPDOWN_CLICK_FINDMYPHONE, DROPDOWN_DROPDOWN_FIND_PHONE_B }, + { DROPDOWN_CLICK_APPLIST, DROPDOWN_DROPDOWN_FIND_PHONE_B}, { DROPDOWN_CLICK_ALARM, DROPDOWN_DROPDOWN_ALARM_B }, { DROPDOWN_CLICK_SETTING, DROPDOWN_DROPDOWN_SETTING_B } }; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp index 7e8cb3053..61730b7e5 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp @@ -152,7 +152,7 @@ void PullUpDownView::InitViewImg(void) } finPhone->SetPosition(PHONE_IMG_X, PHONE_IMG_Y); ScreenModels::GetInstance()->LoadAppImages(DROPDOWN_IAMGES, finPhone, DROPDOWN_DROPDOWN_FIND_PHONE); - finPhone->SetViewId(DROPDOWN_CLICK_FINDMYPHONE); // 找手机界面 DROP_DOWN_FIND_PHONE + finPhone->SetViewId(DROPDOWN_CLICK_APPLIST); // 找手机界面 DROP_DOWN_FIND_PHONE finPhone->SetTouchable(true); finPhone->SetOnClickListener(clickListener); @@ -204,10 +204,13 @@ void PullUpDownView::InitViewLable(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "finPhoneLable new fail"); return; } + finPhoneLable->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); finPhoneLable->SetPosition(PHONE_LABEL_X, PHONE_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT); - finPhoneLable->SetText("找手机"); + finPhoneLable->SetText("应用列表"); finPhoneLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE); finPhoneLable->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + finPhoneLable->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + finPhoneLable->SetRollSpeed(0); droAlarmLable = new UILabel(); if (finPhoneLable == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "finPhoneLable new fail"); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp index 321a1a969..2ad0889ab 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersPresenter.cpp @@ -930,7 +930,8 @@ void PlayerOnDragListener::OnDragChangView(const DragEvent& event, int16_t hideV //增加按键事件 bool PlayerOnDragListener::OnKeyAct(UIView& view, const KeyEvent& event) { -uint16 keyID = event.GetKeyId(); + printf("into the view is: %s\n", typeid(view).name()); + uint16 keyID = event.GetKeyId(); printf("into key!\n"); #if 0 //如果是power键就返回上一级 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp index f60c9d20b..9d0462e06 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempJoinStudy.cpp @@ -169,6 +169,9 @@ bool TempJoinStudy::InitJoinStudy(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempJoinStudy::InitJoinStudy TempPresenter::GetInstance() nullptr"); return false; } + //增加按键监听 + RootView::OnKeyActListener*keyactListener = (RootView::OnKeyActListener*)OHOS::TempPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); UIView::OnDragListener *listener = static_cast(TempPresenter::GetInstance()); SetOnDragListener(listener); SetDraggable(true); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp index 362ca5cc6..21804007f 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/temperature/src/TempStudyAbout.cpp @@ -122,8 +122,14 @@ bool TempStudyAbout::InitStudyAbout(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TempStudyAbout::InitStudyAbout TempPresenter::GetInstance() nullptr"); return false; } + + //增加按键监听 + RootView::OnKeyActListener*keyactListener = (RootView::OnKeyActListener*)OHOS::TempPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); + UIView::OnDragListener *listener = static_cast(TempPresenter::GetInstance()); SetOnDragListener(listener); + SetHorizontalScrollState(false); SetScrollBlankSize(50); // 50:font size SetDraggable(true);