pull/1112/head
gedoor 3 years ago
parent f75738f685
commit 8b8f362248
  1. 2
      app/build.gradle
  2. 1
      app/src/main/java/io/legado/app/App.kt
  3. 4
      app/src/main/java/io/legado/app/utils/EventBusExtensions.kt

@ -162,7 +162,7 @@ dependencies {
testImplementation "androidx.room:room-testing:$room_version"
//liveEventBus
implementation 'com.jeremyliao:live-event-bus-x:1.5.7'
implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'
//
def coroutines_version = '1.4.3'

@ -26,7 +26,6 @@ class App : MultiDexApplication() {
createNotificationChannels()
applyDayNight(this)
LiveEventBus.config()
.supportBroadcast(this)
.lifecycleObserverAlwaysActive(true)
.autoClear(false)
registerActivityLifecycleCallbacks(ActivityHelp)

@ -13,11 +13,11 @@ inline fun <reified EVENT> eventObservable(tag: String): Observable<EVENT> {
}
inline fun <reified EVENT> postEvent(tag: String, event: EVENT) {
LiveEventBus.get(tag).post(event)
LiveEventBus.get<Any>(tag).post(event)
}
inline fun <reified EVENT> postEventDelay(tag: String, event: EVENT, delay: Long) {
LiveEventBus.get(tag).postDelay(event, delay)
LiveEventBus.get<Any>(tag).postDelay(event, delay)
}
inline fun <reified EVENT> AppCompatActivity.observeEvent(

Loading…
Cancel
Save