Smarteventbus

📮SmartEventBus是一个Android平台的消息总线框架,这是一款非常smart的消息总

SmartEventBus

license version

SmartEventBusAndroidsmart

logo

| | | Sticky | | /APP | Customize | ---|---|---|---|---|---|----|--- EventBus | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ RxBus | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ LiveEventBus | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ SmartEventBus | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌

Android

SmartEventBus

1.

@SmartEvent(keys = {"event1", "event2", "event3"})
public class MessageEvent {

    public String msg;

    public MessageEvent(String msg) {
        this.msg = msg;
    }
}

2.

@SmartEventConfig(packageName = "yourPackageName", busName = "YourClassName")
public class BaseEventConfig {
}
  • yourPackageName.YourClassName
  • DefaultSmartEventBus

3.

MySmartEventBus
        .event1()
        .observe(this, new Observer<MessageEvent>() {
            @Override
            public void onChanged(@Nullable MessageEvent event) {
            }
        });
MySmartEventBus
        .event1()
        .post(new MessageEvent("msg from smarteventbus"));

4.

implementation 'com.jeremyliao:smart-event-bus-base:0.0.1'
annotationProcessor 'com.jeremyliao:smart-event-bus-compiler:0.0.2'

-dontwarn com.jeremyliao.liveeventbus.**
-keep class com.jeremyliao.liveeventbus.** { *; }

SmartEventBusinvoking-message