mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 09:12:41 +00:00
add animator log
Signed-off-by: hehongyang9 <hehongyang@huawei.com> Change-Id: I01e50ea583c5bd190b1f39b02ebc55f85d0c59a6
This commit is contained in:
parent
91f642ae59
commit
784e47df86
@ -101,6 +101,8 @@ bool Animator::AttachSchedulerOnContainer()
|
||||
{
|
||||
auto pipeline = PipelineBase::GetCurrentContextSafely();
|
||||
CHECK_NULL_RETURN(pipeline, false);
|
||||
TAG_LOGI(AceLogTag::ACE_ANIMATION, "animator binds to context %{public}d, id:%{public}d", pipeline->GetInstanceId(),
|
||||
GetId());
|
||||
AttachScheduler(pipeline);
|
||||
return true;
|
||||
}
|
||||
@ -510,6 +512,7 @@ void Animator::Stop()
|
||||
}
|
||||
status_ = Status::STOPPED;
|
||||
asyncTrace_ = nullptr;
|
||||
TAG_LOGI(AceLogTag::ACE_ANIMATION, "animator stop, id:%{public}d", GetId());
|
||||
StatusListenable::NotifyStopListener();
|
||||
for (auto& controller : proxyControllers_) {
|
||||
controller->Stop();
|
||||
|
@ -609,10 +609,13 @@ static napi_value SetOnfinish(napi_env env, napi_callback_info info)
|
||||
napi_create_reference(env, onfinish, 1, &onfinishRef);
|
||||
animatorResult->SetOnfinishRef(onfinishRef);
|
||||
animator->ClearStopListeners();
|
||||
TAG_LOGI(AceLogTag::ACE_ANIMATION, "ohos.animator set finish callback, id:%{public}d", animator->GetId());
|
||||
animator->AddStopListener([env, onfinishRef, id = animator->GetId()] {
|
||||
napi_handle_scope scope = nullptr;
|
||||
napi_open_handle_scope(env, &scope);
|
||||
if (scope == nullptr) {
|
||||
TAG_LOGI(AceLogTag::ACE_ANIMATION,
|
||||
"ohos.animator call finish callback failed, scope is null, id:%{public}d", id);
|
||||
return;
|
||||
}
|
||||
napi_value ret = nullptr;
|
||||
@ -620,6 +623,8 @@ static napi_value SetOnfinish(napi_env env, napi_callback_info info)
|
||||
auto result = napi_get_reference_value(env, onfinishRef, &onfinish);
|
||||
if (result != napi_ok || onfinish == nullptr) {
|
||||
napi_close_handle_scope(env, scope);
|
||||
TAG_LOGI(AceLogTag::ACE_ANIMATION,
|
||||
"ohos.animator call finish callback failed, get onFinish failed, id:%{public}d", id);
|
||||
return;
|
||||
}
|
||||
TAG_LOGI(AceLogTag::ACE_ANIMATION, "ohos.animator call finish callback, id:%{public}d", id);
|
||||
|
Loading…
Reference in New Issue
Block a user