diff --git a/Android/app/src/main/java/com/github/pengfeizhou/hegodemo/MainActivity.java b/Android/app/src/main/java/com/github/pengfeizhou/hegodemo/MainActivity.java index a762b2e0..d84da1b9 100644 --- a/Android/app/src/main/java/com/github/pengfeizhou/hegodemo/MainActivity.java +++ b/Android/app/src/main/java/com/github/pengfeizhou/hegodemo/MainActivity.java @@ -4,7 +4,7 @@ import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.github.pengfeizhou.hego.HegoContext; -import com.github.pengfeizhou.hego.HegoUtils; +import com.github.pengfeizhou.hego.utils.HegoUtils; public class MainActivity extends AppCompatActivity { @@ -13,6 +13,6 @@ public class MainActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); HegoContext hegoContext = HegoContext.createContext(HegoUtils.readAssetFile("demo.js"), "demo"); - hegoContext.callJS("log"); + hegoContext.callEntity("log"); } } diff --git a/Android/app/src/main/java/com/github/pengfeizhou/hegodemo/MyApplication.java b/Android/app/src/main/java/com/github/pengfeizhou/hegodemo/MyApplication.java index 16ec3020..17aa3ead 100644 --- a/Android/app/src/main/java/com/github/pengfeizhou/hegodemo/MyApplication.java +++ b/Android/app/src/main/java/com/github/pengfeizhou/hegodemo/MyApplication.java @@ -5,7 +5,7 @@ import android.app.Application; import com.github.pengfeizhou.hego.Hego; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/Hego.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/Hego.java index 241406a9..76216108 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/Hego.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/Hego.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoContext.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoContext.java index 0f6305f1..7c7e204c 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoContext.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoContext.java @@ -3,7 +3,7 @@ package com.github.pengfeizhou.hego; import java.util.concurrent.atomic.AtomicInteger; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ @@ -21,7 +21,7 @@ public class HegoContext { return new HegoContext(contextId); } - public void callJS(String methodName, Object... args) { + public void callEntity(String methodName, Object... args) { HegoDriver.getInstance().invokeContextMethod(mContextId, methodName, args); } diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoDriver.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoDriver.java index 3a2777ab..451cb41f 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoDriver.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoDriver.java @@ -1,9 +1,11 @@ package com.github.pengfeizhou.hego; +import com.github.pengfeizhou.hego.engine.HegoJSEngine; +import com.github.pengfeizhou.hego.utils.HegoSettableFuture; import com.github.pengfeizhou.jscore.JSDecoder; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoJSEngine.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/HegoJSEngine.java similarity index 95% rename from Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoJSEngine.java rename to Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/HegoJSEngine.java index 39953f29..d011e1d9 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoJSEngine.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/HegoJSEngine.java @@ -1,4 +1,4 @@ -package com.github.pengfeizhou.hego; +package com.github.pengfeizhou.hego.engine; import android.os.Handler; import android.os.HandlerThread; @@ -6,9 +6,11 @@ import android.os.Looper; import android.os.Message; import android.text.TextUtils; -import com.github.pengfeizhou.hego.jse.HegoJSExecutor; -import com.github.pengfeizhou.hego.jse.IHegoJSE; -import com.github.pengfeizhou.jscore.ArchiveException; +import com.github.pengfeizhou.hego.Hego; +import com.github.pengfeizhou.hego.utils.HegoConstant; +import com.github.pengfeizhou.hego.utils.HegoLog; +import com.github.pengfeizhou.hego.utils.HegoSettableFuture; +import com.github.pengfeizhou.hego.utils.HegoUtils; import com.github.pengfeizhou.jscore.JSDecoder; import com.github.pengfeizhou.jscore.JavaFunction; import com.github.pengfeizhou.jscore.JavaValue; @@ -16,10 +18,9 @@ import com.github.pengfeizhou.jscore.JavaValue; import org.json.JSONObject; import java.util.ArrayList; -import java.util.concurrent.FutureTask; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/jse/HegoJSExecutor.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/HegoJSExecutor.java similarity index 95% rename from Android/hego/src/main/java/com/github/pengfeizhou/hego/jse/HegoJSExecutor.java rename to Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/HegoJSExecutor.java index 7a12eb4c..d5548cda 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/jse/HegoJSExecutor.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/HegoJSExecutor.java @@ -1,4 +1,4 @@ -package com.github.pengfeizhou.hego.jse; +package com.github.pengfeizhou.hego.engine; import com.github.pengfeizhou.jscore.JSDecoder; import com.github.pengfeizhou.jscore.JSExecutor; @@ -7,7 +7,7 @@ import com.github.pengfeizhou.jscore.JavaFunction; import com.github.pengfeizhou.jscore.JavaValue; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/jse/IHegoJSE.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/IHegoJSE.java similarity index 97% rename from Android/hego/src/main/java/com/github/pengfeizhou/hego/jse/IHegoJSE.java rename to Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/IHegoJSE.java index 12f28505..fd6f43ec 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/jse/IHegoJSE.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/engine/IHegoJSE.java @@ -1,4 +1,4 @@ -package com.github.pengfeizhou.hego.jse; +package com.github.pengfeizhou.hego.engine; import com.github.pengfeizhou.jscore.JSDecoder; import com.github.pengfeizhou.jscore.JSRuntimeException; @@ -6,7 +6,7 @@ import com.github.pengfeizhou.jscore.JavaFunction; import com.github.pengfeizhou.jscore.JavaValue; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoConstant.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoConstant.java similarity index 95% rename from Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoConstant.java rename to Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoConstant.java index d899200f..bcc306a8 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoConstant.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoConstant.java @@ -1,7 +1,7 @@ -package com.github.pengfeizhou.hego; +package com.github.pengfeizhou.hego.utils; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoLog.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoLog.java similarity index 89% rename from Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoLog.java rename to Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoLog.java index 814bee5f..e0f95939 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoLog.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoLog.java @@ -1,9 +1,11 @@ -package com.github.pengfeizhou.hego; +package com.github.pengfeizhou.hego.utils; import android.util.Log; +import com.github.pengfeizhou.hego.Hego; + /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoSettableFuture.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoSettableFuture.java similarity index 96% rename from Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoSettableFuture.java rename to Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoSettableFuture.java index 25cf099a..805bf8ae 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoSettableFuture.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoSettableFuture.java @@ -1,7 +1,7 @@ -package com.github.pengfeizhou.hego; +package com.github.pengfeizhou.hego.utils; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */ diff --git a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoUtils.java b/Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoUtils.java similarity index 89% rename from Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoUtils.java rename to Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoUtils.java index b83859c5..ee5a068f 100644 --- a/Android/hego/src/main/java/com/github/pengfeizhou/hego/HegoUtils.java +++ b/Android/hego/src/main/java/com/github/pengfeizhou/hego/utils/HegoUtils.java @@ -1,12 +1,14 @@ -package com.github.pengfeizhou.hego; +package com.github.pengfeizhou.hego.utils; import android.content.res.AssetManager; +import com.github.pengfeizhou.hego.Hego; + import java.io.IOException; import java.io.InputStream; /** - * @Description: Android + * @Description: Hego * @Author: pengfei.zhou * @CreateDate: 2019-07-18 */