Android代码-EventBus-Apt

时间:2022-08-28 01:26:51
【文件属性】:
文件名称:Android代码-EventBus-Apt
文件大小:155KB
文件格式:ZIP
更新时间:2022-08-28 01:26:51
Android代码 EventBus 事件总线 简介 事件总线的思路源于 https://github.com/greenrobot/EventBus 不过代码和实现方式完全不同于EventBus. greenrobot的EventBus是通过 onEvent的方式,然后定义Event实体类 而本项目的代码是通过用户定义IEvent接口,然后apt实现接口负责分发调用注册者的方法,使用者通过这个实现类去调用接口的方法,直接通知注册者 Gradle导入 //eventbus 核心api compile 'com.shizhefei:eventbus-api:1.2.1' //eventbus 注解 compile 'com.shizhefei:eventbus-annotation:1.2.1' 在定义Event接口的Module添加,以便于生成Event接口的代理 annotationProcessor 'com.shizhefei:eventbus-compiler:1.2.1' 在Application初始化 //是否支持跨进程的事件,false表示不支持跨进程 EventBus.
【文件预览】:
EventBus-Apt-master
----gradlew.bat(2KB)
----gradlew(5KB)
----gradle.properties(730B)
----License.md(11KB)
----app()
--------proguard-rules.pro(5KB)
--------src()
--------.gitignore(7B)
--------build.gradle(1KB)
----gradle()
--------wrapper()
----buildsystem()
--------library.gradle(475B)
--------config.gradle(5KB)
----eventbus-api()
--------src()
--------.gitignore(7B)
--------build.gradle(786B)
----.gitignore(87B)
----app-news()
--------proguard-rules.pro(939B)
--------src()
--------.gitignore(7B)
--------build.gradle(567B)
----README.md(5KB)
----settings.gradle(91B)
----eventbus-compiler()
--------src()
--------.gitignore(7B)
--------build.gradle(917B)
----eventbus-annotation()
--------src()
--------.gitignore(7B)
--------build.gradle(553B)
----build.gradle(956B)

网友评论