feat: add snapshot feature for devkit, this is for android
This commit is contained in:
@@ -131,6 +131,9 @@ public class DoricContext {
|
||||
}
|
||||
|
||||
public void init(String initData) {
|
||||
if (DoricRegistry.isEnableRenderSnapshot()) {
|
||||
callEntity("__enableSnapshot__");
|
||||
}
|
||||
this.extra = initData;
|
||||
if (!TextUtils.isEmpty(initData)) {
|
||||
callEntity(DoricConstant.DORIC_ENTITY_INIT, initData);
|
||||
|
@@ -21,8 +21,6 @@ import android.util.Log;
|
||||
|
||||
import com.github.pengfeizhou.jscore.JSDecoder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
@@ -85,6 +85,8 @@ public class DoricRegistry {
|
||||
|
||||
private static boolean enablePerformance = false;
|
||||
|
||||
private static boolean enableRenderSnapshot = false;
|
||||
|
||||
public static void enablePerformance(boolean enable) {
|
||||
enablePerformance = enable;
|
||||
}
|
||||
@@ -93,6 +95,14 @@ public class DoricRegistry {
|
||||
return enablePerformance;
|
||||
}
|
||||
|
||||
public static void enableRenderSnapshot(boolean enable) {
|
||||
enableRenderSnapshot = enable;
|
||||
}
|
||||
|
||||
public static boolean isEnableRenderSnapshot() {
|
||||
return enableRenderSnapshot;
|
||||
}
|
||||
|
||||
private static void initRegistry(DoricRegistry doricRegistry) {
|
||||
for (DoricLibrary library : doricLibraries) {
|
||||
library.load(doricRegistry);
|
||||
|
Reference in New Issue
Block a user