mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
commit
17c0f2b04d
@ -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));
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user