RxBusDemo

所属分类:android开发
开发工具:Java
文件大小:24673KB
下载次数:2
上传日期:2017-10-12 17:09:55
上 传 者阿凡达舒服地
说明:  rxbus 的实现,试用于使用了rxjava的同学,替代eventbus
(Implementation of rxbus)

文件列表:
RxBusDemo (0, 2016-06-13)
RxBusDemo\.DS_Store (6148, 2016-06-13)
__MACOSX (0, 2017-10-12)
__MACOSX\RxBusDemo (0, 2017-10-12)
__MACOSX\RxBusDemo\._.DS_Store (120, 2016-06-13)
... ...

# RxBus 通过RxJava实现Rxbus。 相信大家已经非常熟悉EventBus了。最近正在学习Rxjava,如果在项目中已经使用了Rxjava,使用RxBus来代替EventBus应该是不错的选择。 ``` public class RxBus { private static RxBus rxBus; private final Subject _bus = new SerializedSubject<>(PublishSubject.create()); private RxBus(){} public static RxBus getInstance(){ if (rxBus == null){ synchronized (RxBus.class){ if (rxBus == null){ rxBus = new RxBus(); } } } return rxBus; } public void send(Object o) { _bus.onNext(o); } public Observable toObserverable() { return _bus; } } ``` ## 推荐文章 - [给 Android 开发者的 RxJava 详解](http://gank.io/post/560e15be2dca930e00da1083) - [深入浅出RxJava](http://blog.csdn.net/lzyzsd/article/details/41833541/) - [RxJava操作符](http://blog.chinaunix.net/uid-20771867-id-5187376.html) - [Retrofit](http://square.github.io/retrofit/) - [使用RxBinding响应控件的异步事件](http://www.jianshu.com/p/c2c7c46e6b97/comments/1338430) - [MVC,MVP,MVVM与架构经验谈](https://www.sdk.cn/news/2501) - [Android平台上MVP的介绍](https://github.com/bboyfeiyu/android-tech-frontier/blob/master/issue-12%2FAndroid%E4%B8%8AMVP%E7%9A%84%E4%BB%8B%E7%BB%8D.md#使用mvp) ## 参考资料 - [FlowGeek](https://git.oschina.net/handoop/FlowGeek):开源中国Android客户端MVP架构Material Design设计风格版 - [Implementing an Event Bus With RxJava – RxBus](http://nerds.weddingpartyapp.com/tech/2014/12/24/implementing-an-event-bus-with-rxjava-rxbus/) ## Note - 本人技术和见识都有限,一些解决方案可能幼稚的可怕,希望大家不吝赐教,共同进步。 - 请使用android版本5.1以上的手机以保证最佳效果。 - 数据接口来自网路,如有侵权,立刻删除。 - Stay hungry, Stay foolish。
近期下载者

相关文件


收藏者