From 4b3750519d678d1563adc1e5ef649b037ebb900c Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 9 Jul 2021 18:21:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/utils/EventBusExtensions.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/utils/EventBusExtensions.kt b/app/src/main/java/io/legado/app/utils/EventBusExtensions.kt index fb47cde54..a94e7d1aa 100644 --- a/app/src/main/java/io/legado/app/utils/EventBusExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/EventBusExtensions.kt @@ -20,6 +20,10 @@ inline fun postEventDelay(tag: String, event: EVENT, delay: Long LiveEventBus.get(tag).postDelay(event, delay) } +inline fun postEventOrderly(tag: String, event: EVENT) { + LiveEventBus.get(tag).postOrderly(event) +} + inline fun AppCompatActivity.observeEvent( vararg tags: String, noinline observer: (EVENT) -> Unit @@ -32,7 +36,6 @@ inline fun AppCompatActivity.observeEvent( } } - inline fun AppCompatActivity.observeEventSticky( vararg tags: String, noinline observer: (EVENT) -> Unit @@ -67,5 +70,4 @@ inline fun Fragment.observeEventSticky( tags.forEach { eventObservable(it).observeSticky(this, o) } -} - +} \ No newline at end of file