!45792 点击事件, 增加维测

Merge pull request !45792 from 眼神不撒旦/master
This commit is contained in:
openharmony_ci 2024-10-21 14:06:23 +00:00 committed by Gitee
commit 17c0f2b04d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 10 additions and 1 deletions

View File

@ -432,7 +432,9 @@ void FormManagerDelegate::AddGetRectRelativeToWindowCallback(OnGetRectRelativeTo
void FormManagerDelegate::AddActionEventHandle(const ActionEventHandle& callback)
{
TAG_LOGI(AceLogTag::ACE_FORM, "EventHandle - AddActionEventHandle");
if (!callback || state_ == State::RELEASED) {
TAG_LOGI(AceLogTag::ACE_FORM, "EventHandle - ,state_ is RELEASED");
return;
}
actionEventHandle_ = callback;
@ -450,6 +452,8 @@ void FormManagerDelegate::AddEnableFormCallback(EnableFormCallback&& callback)
void FormManagerDelegate::OnActionEventHandle(const std::string& action)
{
if (actionEventHandle_) {
TAG_LOGI(AceLogTag::ACE_FORM, "EventHandle - OnActionEventHandle ,formId: %{public}" PRId64,
runningCardId_);;
actionEventHandle_(action);
}
}
@ -542,7 +546,11 @@ void FormManagerDelegate::RegisterRenderDelegateEvent()
auto&& actionEventHandler = [weak = WeakClaim(this)](const std::string& action) {
auto formManagerDelegate = weak.Upgrade();
CHECK_NULL_VOID(formManagerDelegate);
TAG_LOGI(AceLogTag::ACE_FORM, "EventHandle - AddActionEventHandle");
if (!formManagerDelegate) {
TAG_LOGE(AceLogTag::ACE_FORM, "EventHandle - ,formManagerDelegate is null");
return;
}
formManagerDelegate->OnActionEventHandle(action);
};
renderDelegate_->SetActionEventHandler(std::move(actionEventHandler));

View File

@ -117,6 +117,7 @@ void FormRendererDelegateImpl::SetSurfaceCreateEventHandler(
void FormRendererDelegateImpl::SetActionEventHandler(std::function<void(const std::string&)>&& listener)
{
HILOG_INFO("EventHandle - SetActionEventHandler");
actionEventHandler_ = std::move(listener);
}