From 42b6b210c72dad734cb8c07391cdb8abcbcfb0e5 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 13 Jan 2026 17:21:17 +0800 Subject: [PATCH] =?utf8?q?=E8=BF=98=E5=8E=9Fui=5Flist.cpp=E4=B8=AD?= =?utf8?q?=E5=85=B3=E4=BA=8E=E8=A1=A8=E5=86=A0=E9=9C=87=E5=8A=A8=E7=9A=84?= =?utf8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../ui/frameworks/components/ui_list.cpp | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp index ba279a811..75d331ae9 100644 --- a/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp +++ b/code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_list.cpp @@ -17,9 +17,6 @@ #include "components/ui_abstract_scroll_bar.h" #include "gfx_utils/graphic_log.h" -#if ENABLE_VIBRATOR -#include "hal_tick.h" -#endif namespace OHOS { UIList::Recycle::~Recycle() @@ -153,11 +150,6 @@ void UIList::Recycle::MoveAdapterItemsRelativeRect(int16_t x, int16_t y) UIList::UIList() : UIList(VERTICAL) {} -/* --------------------------------- 减少震动次数 --------------------------------- */ -static uint32_t lastVibratorTime_; -static constexpr uint32_t MIN_VIBRATOR_INTERVAL_MS = 100; // 最小振动间隔100毫秒 -/* -------------------------------------------------------------------------- */ - UIList::UIList(uint8_t direction) : onSelectedView_(nullptr), isLoopList_(false), @@ -179,7 +171,6 @@ UIList::UIList(uint8_t direction) #if ENABLE_VIBRATOR needVibration_ = false; vibratorType_ = VibratorType::VIBRATOR_TYPE_ONE; - lastVibratorTime_ = 0; #endif #if ENABLE_FOCUS_MANAGER focusable_ = true; @@ -716,25 +707,6 @@ void UIList::MoveChildByOffset(int16_t xOffset, int16_t yOffset) } } #if ENABLE_VIBRATOR - VibratorFunc vibratorFunc = VibratorManager::GetInstance()->GetVibratorFunc(); - if (isSelectViewFind && needVibration_ && vibratorFunc != nullptr) { - printf("isSelectViewFind = %d\n", isSelectViewFind); - uint32_t currentTime = HALTick::GetInstance().GetTime(); - // 只有在规定时间间隔后才允许调用振动(首次调用时lastVibratorTime_为0,允许调用) - bool canVibrate = (lastVibratorTime_ == 0) || - (HALTick::GetInstance().GetElapseTime(lastVibratorTime_) >= MIN_VIBRATOR_INTERVAL_MS); - if (canVibrate) { - if (!isLoopList_ && (onSelectedIndex_ == 0 || onSelectedIndex_ == recycle_.adapter_->GetCount() - 1)) { - vibratorFunc(VibratorType::VIBRATOR_TYPE_THREE); - GRAPHIC_LOGI("UIList::MoveChildByOffset calls TYPE_THREE vibrator"); - } else { - vibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); - GRAPHIC_LOGI("UIList::MoveChildByOffset calls TYPE_TWO vibrator"); - } - lastVibratorTime_ = currentTime; - } - } - #if 0 VibratorFunc vibratorFunc = VibratorManager::GetInstance()->GetVibratorFunc(); if (isSelectViewFind && needVibration_ && vibratorFunc != nullptr) { if (!isLoopList_ && (onSelectedIndex_ == 0 || onSelectedIndex_ == recycle_.adapter_->GetCount() - 1)) { @@ -745,7 +717,6 @@ void UIList::MoveChildByOffset(int16_t xOffset, int16_t yOffset) GRAPHIC_LOGI("UIList::MoveChildByOffset calls TYPE_TWO vibrator"); } } - #endif #endif } view = view->GetNextSibling(); -- 2.17.1