Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dora4/dora-apollo-support
🧩 Dora MVVM框架扩展包 - 用于整合Apollo消息通信框架
https://github.com/dora4/dora-apollo-support
Last synced: about 2 months ago
JSON representation
🧩 Dora MVVM框架扩展包 - 用于整合Apollo消息通信框架
- Host: GitHub
- URL: https://github.com/dora4/dora-apollo-support
- Owner: dora4
- Created: 2023-07-13T23:20:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-30T10:00:20.000Z (3 months ago)
- Last Synced: 2024-10-30T11:16:58.942Z (3 months ago)
- Language: Kotlin
- Homepage:
- Size: 109 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
dora-apollo-support
![Release](https://jitpack.io/v/dora4/dora-apollo-support.svg)
--------------------------------#### gradle依赖配置
```groovy
// 添加以下代码到项目根目录下的build.gradle
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
// 添加以下代码到app模块的build.gradle.kts
dependencies {
// 扩展包必须在有主框架dora的情况下使用
implementation("com.github.dora4:dora:1.2.32")
implementation("com.github.dora4:dora-apollo-support:1.4")
// Apollo的编译时注解处理器
kapt("com.github.lsxiao.Apollo:processor:1.0.2")
}
```#### 使用方式
在AndroidManifest中加入配置。
```xml
```
你可以使用Apollo.emit()发送事件,并在Activity和Fragment中可以直接接收事件,在其他类需要在初始化的时候手动调用Apollo.bind(this)才能接收到事件。
```kotlin
@Receive(ApolloEvent.YOUR_CUSTOM_EVENT)
fun onReceiveEvent()
// 你的事件处理逻辑
}
```