From: hcj <1224667075@qq.com> Date: Sat, 30 Mar 2024 08:56:36 +0000 (+0800) Subject: 产测模式入口 X-Git-Tag: release_V1.2.70_20241020_135402~1241^2~6^2~1 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=57a91df4f04d6a34d8f5433a5af1b4891a746aaa;p=mirrors%2FFD230.git 产测模式入口 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h index 9a7720efe..a863774f9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h @@ -35,7 +35,9 @@ namespace OHOS HRSENSON, GSENSON, OLDTEST, + shutdown, TEST_1, + MAX_TESTVIEWID, } TEST_VIEW; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp index 1d437bd2d..1ec1fff41 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -51,7 +51,8 @@ namespace OHOS {MAKEPHONE,"makephonebutton", "hrsensonbutton_next",true}, {HRSENSON,"hrsensonbutton", "gsensonbutton_next",true}, {GSENSON,"gsensonbutton","xxxx" ,true}, - {OLDTEST,"oldtestbutton","xxxxxxxxx",true}, + {OLDTEST,"oldtestbutton","xxxx",true}, + {shutdown,"shutdown","xxxxxxxxx",true}, }; // {FACTORYRESETVIEW,"FactoryResetButton",true}, // {SYSTEMLUPGRADE,"systemupgread",true}, @@ -181,6 +182,10 @@ namespace OHOS testView::GetInstance()->ChangeView(GSENSON,TESTVIEW); return true; } + if(strcmp(view.GetViewId(),"shutdown") == 0) + { + uapi_poweroff_device(); + } for(int i=0;iSetVisible(true); Draw(); - // if(hideView!=0) - // { - // switch (hideView) - // { - // case VISON: - // delete test_about_view; - // test_about_view = nullptr; - // break; - // case LCD: - // delete test_LCD_view; - // test_LCD_view = nullptr; - // break; - // case TP: - // delete test_TP_view; - // test_TP_view = nullptr; + if(hideView!=0) + { + switch (hideView) + { + case VISON: + RootView::GetInstance()->Remove(SystemScrollView[hideView]); + delete test_about_view; + test_about_view = nullptr; + break; + case LCD: + RootView::GetInstance()->Remove(SystemScrollView[hideView]); + delete test_LCD_view; + test_LCD_view = nullptr; + break; + case TP: + RootView::GetInstance()->Remove(SystemScrollView[hideView]); + delete test_TP_view; + test_TP_view = nullptr; + } + } // break; // case MAGETIC: // delete test_MG_view; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemAboutTheWatchView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemAboutTheWatchView.cpp index 56cfa2b85..5b382316e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemAboutTheWatchView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemAboutTheWatchView.cpp @@ -108,8 +108,13 @@ namespace OHOS return false; } SystemAboutTheWatchScrollView->SetOnDragListener(draglistener); + SystemAboutTheWatchScrollView->SetTouchable(true); SystemAboutTheWatchScrollView->SetDraggable(true); + + SystemAboutTheWatchScrollView->SetViewId("SystemAboutTheWatchTitle"); + UIView::OnClickListener *touch = static_cast(SystemPresenter::GetInstance()); + SystemAboutTheWatchScrollView->SetOnClickListener(touch); return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp index f3c48e3ad..aa995c18e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp @@ -60,10 +60,14 @@ namespace OHOS Presenter::OnStart(); } - void SystemPresenter::OnPause(void) + static uint32_t time=0; + static uint32_t OnClick_num=0; + + bool SystemPresenter::OnPress(UIView &view, const PressEvent &event) { + - Presenter::OnPause(); + } void SystemPresenter::OnResume(void) @@ -109,22 +113,54 @@ namespace OHOS // int len=5; // 根据控件id查找是哪个控件触发了点击回调 + if(strcmp(view.GetViewId(), "SystemAboutTheWatchTitle")==0) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchTitle"); + if(time==0) + { + time = event.GetTimeStamp(); + OnClick_num=1; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "222 %d",time); + } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "111 %d",event.GetTimeStamp()); + if(event.GetTimeStamp() -time<1000) + { + OnClick_num++; + + if(OnClick_num>5) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_TEST); + } + } + else + { + time =0; + } + } + return true; + } + + for (int i = 0; i < len; i++) { if (strcmp(view.GetViewId(), ViewMapper_t[i].viewid_str) == 0) { if (i == 5) { - NativeAbility::GetInstance().ChangeSlice(VIEW_TEST); + break; } if (ViewMapper_t[i].enable_falg == true) SystemView::GetInstance()->ChangeView(SYSTEMVIEW, ViewMapper_t[i].viewId); + time=0; return true; } } + if (strcmp(view.GetViewId(), FACTORYRESET_CHECKON) == 0) { p_SystemView->ChangeView(FACTORYRESETVIEW, SYSTEMVIEW);