android:adjust Doric.java and DoricKit.java,optimize api
This commit is contained in:
@@ -17,6 +17,9 @@ package pub.doric;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import pub.doric.loader.DoricJSLoaderManager;
|
||||
import pub.doric.loader.IDoricJSLoader;
|
||||
|
||||
/**
|
||||
* @Description: Doric
|
||||
* @Author: pengfei.zhou
|
||||
@@ -25,6 +28,11 @@ import android.app.Application;
|
||||
public class Doric {
|
||||
private static Application sApplication;
|
||||
|
||||
/**
|
||||
* Init Function,must be called before doric run
|
||||
*
|
||||
* @param application Application instance
|
||||
*/
|
||||
public static void init(Application application) {
|
||||
sApplication = application;
|
||||
}
|
||||
@@ -32,4 +40,22 @@ public class Doric {
|
||||
public static Application application() {
|
||||
return sApplication;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register DoricLibrary For Extended ViewNode and Native Plugins
|
||||
*
|
||||
* @param doricLibrary Which registered in global
|
||||
*/
|
||||
public static void registerLibrary(DoricLibrary doricLibrary) {
|
||||
DoricRegistry.register(doricLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add DoricJSLoader For Loading JS bundles
|
||||
*
|
||||
* @param jsLoader Which added in global
|
||||
*/
|
||||
public static void addJSLoader(IDoricJSLoader jsLoader) {
|
||||
DoricJSLoaderManager.getInstance().addJSLoader(jsLoader);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user