From 4b871b953901787422fb4ef90bc0d3509e2f7a2b Mon Sep 17 00:00:00 2001 From: Justson Date: Mon, 10 Aug 2020 10:29:20 +0800 Subject: [PATCH] feat(readme): publish v1.0.4 --- README.md | 18 +++++++----------- .../library/invoker/AbsMethodInvoker.java | 4 ++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9d431b0..f852609 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Flying-Pigeon 内部提供两种跨进程通信方式,来应对各种跨进程 ```gradle -implementation 'com.github.Justson:flying-pigeon:v1.0.3' +implementation 'com.github.Justson:flying-pigeon:v1.0.4' ``` ## 方式一 @@ -32,9 +32,8 @@ ServiceManager.getInstance().publish(mApi); ### Client ``` java final Pigeon pigeon = Pigeon.newBuilder(this).setAuthority(ServiceApiImpl.class).build(); - Api api = pigeon.create(Api.class); - Poster poster = new Poster("Justson", "just", 119, 11111000L, (short) 23, 1.15646F, 'h', (byte) 4, 123456.415D); - api.createPoster(poster); +Api api = pigeon.create(Api.class); +api.createPoster(new Poster("Justson", "just", 119, 11111000L, (short) 23, 1.15646F, 'h', (byte) 4, 123456.415D)); ``` ## 方式二 @@ -42,14 +41,10 @@ final Pigeon pigeon = Pigeon.newBuilder(this).setAuthority(ServiceApiImpl.class) ### Server ```java +@MainThread @route("/query/username") public void queryUsername(final Bundle in, final Bundle out) { - runOnUiThread(new Runnable() { - @Override - public void run() { - ipcLabel.setText("received other app message,\n message:" + in.getString("userid")); - } - }); + ipcLabel.setText("received other app message,\n message:" + in.getString("userid")); out.putString("username", "ipc-sample"); } ``` @@ -66,4 +61,5 @@ Bundle bundle = flyPigeon.route("/query/username").withString("userid", UUID.ran ``` ## 建议 -> 建议App内使用方式一,App与其他App通信使用方式二 \ No newline at end of file +* 建议App内使用方式一,App与其他App通信使用方式二 +* 返回的类型中,尽可能使用基本数据类型的包装类、如Integer,Double,Long,Short,Float,Byte,Boolean,Character \ No newline at end of file diff --git a/library/src/main/java/com/flyingpigeon/library/invoker/AbsMethodInvoker.java b/library/src/main/java/com/flyingpigeon/library/invoker/AbsMethodInvoker.java index 86914ce..d38aa1b 100644 --- a/library/src/main/java/com/flyingpigeon/library/invoker/AbsMethodInvoker.java +++ b/library/src/main/java/com/flyingpigeon/library/invoker/AbsMethodInvoker.java @@ -18,7 +18,7 @@ import com.flyingpigeon.library.annotations.thread.MainThread; import com.flyingpigeon.library.annotations.thread.SingleThread; import com.flyingpigeon.library.execute.Executors; -import com.queue.library.Dispatch; +import com.queue.library.DispatchThread; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -32,7 +32,7 @@ public abstract class AbsMethodInvoker implements MethodInvoker { private final Method target; - private Dispatch mDispatch; + private DispatchThread mDispatch; public AbsMethodInvoker(Method target) { this.target = target;