From: Caisking Date: Wed, 20 Aug 2025 09:47:34 +0000 (+0800) Subject: 增加产测界面的滑动退出 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~152^2~19 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9008b533ee2e8d5c00c45ea6cd612512a2593b81;p=mirrors%2FFD230.git 增加产测界面的滑动退出 --- diff --git a/code/sdk/zhihui/UI/producttest/include/testQRCode.h b/code/sdk/zhihui/UI/producttest/include/testQRCode.h index fdebf6595..5d1cc1ff3 100644 --- a/code/sdk/zhihui/UI/producttest/include/testQRCode.h +++ b/code/sdk/zhihui/UI/producttest/include/testQRCode.h @@ -38,6 +38,7 @@ namespace OHOS bool initViewStatus{false}; UILabel *Title{nullptr}; // 标题 UIQrcode *QRCodeView{nullptr}; // 二维码视图 + UILabelButtonExt *labelButton_next{nullptr}; // 退出按钮 }; } diff --git a/code/sdk/zhihui/UI/producttest/src/testQRCode.cpp b/code/sdk/zhihui/UI/producttest/src/testQRCode.cpp index 7dbd7c684..d46ec4323 100644 --- a/code/sdk/zhihui/UI/producttest/src/testQRCode.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testQRCode.cpp @@ -12,6 +12,7 @@ #include "producttest/include/testQRCode.h" #include "producttest/include/testView.h" #include "producttest/include/testModel.h" +#include "producttest/include/testabout.h" #include "components/ui_qrcode.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" @@ -57,6 +58,11 @@ namespace OHOS delete QRCodeView; QRCodeView = nullptr; } + if (labelButton_next) + { + delete labelButton_next; + labelButton_next = nullptr; + } initViewStatus = false; } @@ -93,6 +99,15 @@ namespace OHOS testQRCodeScrollView->SetTouchable(true); testQRCodeScrollView->SetDraggable(true); + // 设置拖拽监听器,实现滑动退出功能 + UIView::OnDragListener *draglistener = static_cast(testPresenter::GetInstance()); + if (draglistener == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "testQRCodeView::draglistener can not be nullptr!"); + return false; + } + testQRCodeScrollView->SetOnDragListener(draglistener); + // 创建标题 Title = new UILabel(); if (Title == nullptr) @@ -130,6 +145,10 @@ namespace OHOS testQRCodeScrollView->Add(QRCodeView); + // 创建退出按钮 + // labelButton_next = testAboutView::GetInstance()->init_button_next(167, 378, Test_ViewMapper_t[id].viewid_str_next); + // testQRCodeScrollView->Add(labelButton_next); + return true; }