已合并
ArkWeb 新增文字长按框选震动特性 #40330
zhufenghao创建于 2024年8月13日
ArkWeb 新增文字长按框选震动特性 #40330
已合并
从refs/pull/40330/head合入到master
共 2 个文件变更+14-8
| @@ -40,6 +40,7 @@ | |||
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | + | ||
| 43 | 44 | ||
| 44 | 45 | ||
| 45 | 46 | ||
| @@ -5174,6 +5175,7 @@ bool WebDelegate::OnContextMenuShow(const std::shared_ptr<BaseEventInfo>& info) | |||
| 5174 | CHECK_NULL_VOID(webEventHub); | 5175 | CHECK_NULL_VOID(webEventHub); |
| 5175 | auto propOnContextMenuShowEvent = webEventHub->GetOnContextMenuShowEvent(); | 5176 | auto propOnContextMenuShowEvent = webEventHub->GetOnContextMenuShowEvent(); |
| 5176 | CHECK_NULL_VOID(propOnContextMenuShowEvent); | 5177 | CHECK_NULL_VOID(propOnContextMenuShowEvent); |
| 5178 | + NG::VibratorUtils::StartVibraFeedback("longPress.light"); | ||
| 5177 | result = propOnContextMenuShowEvent(info); | 5179 | result = propOnContextMenuShowEvent(info); |
| 5178 | return; | 5180 | return; |
| 5179 | 5181 | ||
| @@ -5188,6 +5190,7 @@ bool WebDelegate::OnContextMenuShow(const std::shared_ptr<BaseEventInfo>& info) | |||
| 5188 | CHECK_NULL_VOID(webEventHub); | 5190 | CHECK_NULL_VOID(webEventHub); |
| 5189 | auto propOnContextMenuShowEvent = webEventHub->GetOnContextMenuShowEvent(); | 5191 | auto propOnContextMenuShowEvent = webEventHub->GetOnContextMenuShowEvent(); |
| 5190 | CHECK_NULL_VOID(propOnContextMenuShowEvent); | 5192 | CHECK_NULL_VOID(propOnContextMenuShowEvent); |
| 5193 | + NG::VibratorUtils::StartVibraFeedback("longPress.light"); | ||
| 5191 | result = propOnContextMenuShowEvent(info); | 5194 | result = propOnContextMenuShowEvent(info); |
| 5192 | return; | 5195 | return; |
| 5193 | } | 5196 | } |
| @@ -27,16 +27,25 @@ | |||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + | ||
| 30 | 34 | ||
| 35 | + | ||
| 31 | 36 | ||
| 32 | 37 | ||
| 33 | 38 | ||
| 34 | 39 | ||
| 35 | 40 | ||
| 36 | 41 | ||
| 42 | + | ||
| 37 | 43 | ||
| 38 | 44 | ||
| 39 | 45 | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + | ||
| 40 | 49 | ||
| 41 | 50 | ||
| 42 | 51 | ||
| @@ -60,14 +69,6 @@ | |||
| 60 | 69 | ||
| 61 | 70 | ||
| 62 | 71 | ||
| 63 | - | ||
| 64 | - | ||
| 65 | - | ||
| 66 | - | ||
| 67 | - | ||
| 68 | - | ||
| 69 | - | ||
| 70 | - | ||
| 71 | namespace OHOS::Ace::NG { | 72 | namespace OHOS::Ace::NG { |
| 72 | namespace { | 73 | namespace { |
| 73 | const std::string IMAGE_POINTER_CONTEXT_MENU_PATH = "etc/webview/ohos_nweb/context-menu.svg"; | 74 | const std::string IMAGE_POINTER_CONTEXT_MENU_PATH = "etc/webview/ohos_nweb/context-menu.svg"; |
| @@ -409,6 +410,7 @@ void WebPattern::OnContextMenuShow(const std::shared_ptr<BaseEventInfo>& info) | |||
| 409 | CHECK_NULL_VOID(contextMenuParam_); | 410 | CHECK_NULL_VOID(contextMenuParam_); |
| 410 | contextMenuResult_ = eventInfo->GetContextMenuResult(); | 411 | contextMenuResult_ = eventInfo->GetContextMenuResult(); |
| 411 | CHECK_NULL_VOID(contextMenuResult_); | 412 | CHECK_NULL_VOID(contextMenuResult_); |
| 413 | + VibratorUtils::StartVibraFeedback("longPress.light"); | ||
| 412 | ShowContextSelectOverlay(RectF(), RectF()); | 414 | ShowContextSelectOverlay(RectF(), RectF()); |
| 413 | } | 415 | } |
| 414 | 416 | ||
| @@ -3470,6 +3472,7 @@ bool WebPattern::RunQuickMenu(std::shared_ptr<OHOS::NWeb::NWebQuickMenuParams> p | |||
| 3470 | } | 3472 | } |
| 3471 | RegisterSelectOverlayCallback(selectInfo, params, callback); | 3473 | RegisterSelectOverlayCallback(selectInfo, params, callback); |
| 3472 | RegisterSelectOverlayEvent(selectInfo); | 3474 | RegisterSelectOverlayEvent(selectInfo); |
| 3475 | + VibratorUtils::StartVibraFeedback("longPress.light"); | ||
| 3473 | selectOverlayProxy_ = pipeline->GetSelectOverlayManager()->CreateAndShowSelectOverlay(selectInfo, WeakClaim(this)); | 3476 | selectOverlayProxy_ = pipeline->GetSelectOverlayManager()->CreateAndShowSelectOverlay(selectInfo, WeakClaim(this)); |
| 3474 | if (selectInfo.isNewAvoid && selectOverlayProxy_) { | 3477 | if (selectInfo.isNewAvoid && selectOverlayProxy_) { |
| 3475 | selectOverlayProxy_->ShowOrHiddenMenu(false); | 3478 | selectOverlayProxy_->ShowOrHiddenMenu(false); |