From 637aef5cddc63e671c3949e0c2569ca5e1e98399 Mon Sep 17 00:00:00 2001 From: maxli Date: Tue, 26 Nov 2024 17:08:14 +0800 Subject: [PATCH] fix(android): update custom createVirtualNode arguments --- .../com/tencent/mtt/hippy/uimanager/ControllerManager.java | 5 +++-- .../com/tencent/mtt/hippy/uimanager/HippyViewController.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/ControllerManager.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/ControllerManager.java index 7f42e845def..c30123a171f 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/ControllerManager.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/ControllerManager.java @@ -442,8 +442,9 @@ public VirtualNode createVirtualNode(int rootId, int id, int pid, int index, @NonNull String className, @Nullable Map props) { HippyViewController controller = mControllerRegistry.getViewController(className); - if (controller != null) { - return controller.createVirtualNode(rootId, id, pid, index, props); + Renderer renderer = mRendererWeakRef.get(); + if (controller != null && renderer instanceof NativeRender) { + return controller.createVirtualNode(rootId, id, pid, index, props, (NativeRender) renderer); } return null; } diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/HippyViewController.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/HippyViewController.java index be449deac6e..505647035f8 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/HippyViewController.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/HippyViewController.java @@ -400,7 +400,7 @@ protected RenderNode createRenderNode(int rootId, int id, @Nullable Map props) { + @Nullable Map props, @NonNull NativeRender nativeRender) { // The host can create customize virtual node in a derived class. return null; }