File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
mvp/src/main/java/cn/droidlover/xdroidmvp/event
test/src/main/java/cn/droidlover/xdroidmvp/test/rxbus Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 77public interface IBus {
88
99 void register (Object object );
10+
1011 void unregister (Object object );
11- void post (IEvent event );
12- void postSticky (IEvent event );
12+
13+ void post (AbsEvent event );
14+
15+ void postSticky (AbsEvent event );
1316
1417
15- interface IEvent {
16- int getTag ();
18+ abstract class AbsEvent {
19+ public abstract int getTag ();
1720 }
1821
1922}
Original file line number Diff line number Diff line change @@ -23,22 +23,22 @@ public void unregister(Object object) {
2323 }
2424
2525 @ Override
26- public void post (IEvent event ) {
26+ public void post (AbsEvent event ) {
2727 RxBus .getDefault ().post (event );
2828 }
2929
3030 @ Override
31- public void postSticky (IEvent event ) {
31+ public void postSticky (AbsEvent event ) {
3232 RxBus .getDefault ().postSticky (event );
3333 }
3434
35- public <T > void subscribe (Object subscriber ,
36- RxBus .Callback <T > callback ) {
35+ public <T extends AbsEvent > void subscribe (Object subscriber ,
36+ RxBus .Callback <T > callback ) {
3737 RxBus .getDefault ().subscribe (subscriber , callback );
3838 }
3939
40- public <T > void subscribeSticky (Object subscriber ,
41- RxBus .Callback <T > callback ) {
40+ public <T extends AbsEvent > void subscribeSticky (Object subscriber ,
41+ RxBus .Callback <T > callback ) {
4242 RxBus .getDefault ().subscribeSticky (subscriber , callback );
4343 }
4444
Original file line number Diff line number Diff line change 66 * Created by wanglei on 2017/1/30.
77 */
88
9- public class LoginEvent implements IBus .IEvent {
9+ public class LoginEvent extends IBus .AbsEvent {
1010
1111 @ Override
1212 public int getTag () {
You can’t perform that action at this time.
0 commit comments