From e73ad1db2b53bbedbb62237194887b2f5bc33434 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Tue, 14 Apr 2020 11:41:12 +0800 Subject: [PATCH] android:fix RootNode type is null --- .../doric/src/main/java/pub/doric/shader/ViewNode.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doric-android/doric/src/main/java/pub/doric/shader/ViewNode.java b/doric-android/doric/src/main/java/pub/doric/shader/ViewNode.java index da157878..926d4681 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/ViewNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/ViewNode.java @@ -24,6 +24,7 @@ import android.content.Context; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.GradientDrawable; +import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateDecelerateInterpolator; @@ -53,6 +54,7 @@ import pub.doric.DoricRegistry; import pub.doric.R; import pub.doric.async.AsyncResult; import pub.doric.extension.bridge.DoricMethod; +import pub.doric.extension.bridge.DoricPlugin; import pub.doric.extension.bridge.DoricPromise; import pub.doric.utils.DoricConstant; import pub.doric.utils.DoricContextHolder; @@ -105,6 +107,9 @@ public abstract class ViewNode extends DoricContextHolder { } public String getType() { + if (TextUtils.isEmpty(mType)) { + mType = this.getClass().getAnnotation(DoricPlugin.class).name(); + } return mType; }