We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
实现方式挺好的,不过发送事件的调用方式在语义上不好理解,能否将“”EventBus.get(...).onXXX(...)“”重构为“”EventBus.obtain(...).sendToTarget()“”更容易理解,类似于安卓sdk的Handler&Message那样
The text was updated successfully, but these errors were encountered:
可考虑充分利用泛型和反射来实现
Sorry, something went wrong.
EventBus.get(...).onXXX(...) get 是get到Event的代理类 后面onXXX是自定的event的方法,属于你自己的不一定用on开头
这倒也是。 我猜想的重构思路如下,不知是否可行: 1、定义一个继承自IEvent的抽象类MessageEvent,里面包含一个final的obtainMessage方法及一个抽象的onMessageReceived方法。 2、额外添加一个Message类作为EventBus.get的通用参数,里面定义两个属性what及obj,以及一个final的sendToTarget方法。 3、sendToTarget里通过Proxy实现onMessageReceived的调用。
No branches or pull requests
实现方式挺好的,不过发送事件的调用方式在语义上不好理解,能否将“”EventBus.get(...).onXXX(...)“”重构为“”EventBus.obtain(...).sendToTarget()“”更容易理解,类似于安卓sdk的Handler&Message那样
The text was updated successfully, but these errors were encountered: