From 19a8aaae94d4328f504c7d19c557826674cfc467 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Thu, 2 Jun 2022 19:47:38 +0800 Subject: [PATCH] android: expose doric's library and registry --- .../doric/src/main/java/pub/doric/DoricRegistry.java | 2 +- .../doric/src/main/java/pub/doric/DoricSingleton.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doric-android/doric/src/main/java/pub/doric/DoricRegistry.java b/doric-android/doric/src/main/java/pub/doric/DoricRegistry.java index c07a3d4c..4430db6a 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricRegistry.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricRegistry.java @@ -93,7 +93,7 @@ public class DoricRegistry { private void initRegistry(DoricRegistry doricRegistry) { - for (DoricLibrary library : DoricSingleton.getInstance().doricLibraries) { + for (DoricLibrary library : DoricSingleton.getInstance().libraries) { library.load(doricRegistry); } } diff --git a/doric-android/doric/src/main/java/pub/doric/DoricSingleton.java b/doric-android/doric/src/main/java/pub/doric/DoricSingleton.java index 0f9ee5fd..e264b16e 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricSingleton.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricSingleton.java @@ -33,8 +33,8 @@ import pub.doric.loader.DoricJSLoaderManager; public class DoricSingleton { final Map bundles = new ConcurrentHashMap<>(); - final Set doricLibraries = new HashSet<>(); - final List> registries = new ArrayList<>(); + public final Set libraries = new HashSet<>(); + public final List> registries = new ArrayList<>(); final Map envMap = new ConcurrentHashMap<>(); private final DoricJSLoaderManager jsLoaderManager = new DoricJSLoaderManager(); @@ -58,7 +58,7 @@ public class DoricSingleton { public void registerLibrary(DoricLibrary doricLibrary) { - doricLibraries.add(doricLibrary); + libraries.add(doricLibrary); for (WeakReference registryWeakReference : registries) { DoricRegistry registry = registryWeakReference.get(); if (registry != null) {