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

@ -20,6 +20,10 @@ inline fun <reified EVENT> postEventDelay(tag: String, event: EVENT, delay: Long
LiveEventBus.get<Any>(tag).postDelay(event, delay)
}
inline fun <reified EVENT> postEventOrderly(tag: String, event: EVENT) {
LiveEventBus.get<Any>(tag).postOrderly(event)
}
inline fun <reified EVENT> AppCompatActivity.observeEvent(
vararg tags: String,
noinline observer: (EVENT) -> Unit
@ -32,7 +36,6 @@ inline fun <reified EVENT> AppCompatActivity.observeEvent(
}
}
inline fun <reified EVENT> AppCompatActivity.observeEventSticky(
vararg tags: String,
noinline observer: (EVENT) -> Unit
@ -67,5 +70,4 @@ inline fun <reified EVENT> Fragment.observeEventSticky(
tags.forEach {
eventObservable<EVENT>(it).observeSticky(this, o)
}
}
}
Loading…
Cancel
Save