项目地址

https://github.com/ddnosh/android-tiny-bus
TinyBus: 一个简洁的event bus库

功能介绍

  1. 提供一个poster和register;
  2. 在接收的位置用@Subscriber注释标明;
  3. (20190106)@Subscriber支持接收方是在主线程还是子线程中接收poster的消息;

用法

  1. 接收方: TinyBus.getInstance().register(this), 并且在接收的方法上用@Subscriber标明;
  2. 发送方: TinyBus.getInstance().post(new TestEvent());
  3. 释放接收方: TinyBus.getInstance().release(this), 防止内存泄露;

TODO

  1. (done in 20190106) 指定接收方处理event的线程;
  2. event的优先级;

相关文章: