Merge branch 'gedoor:master' into master

pull/1112/head
bushixuanqi 3 years ago committed by GitHub
commit 30cc06e038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/build.gradle
  2. 1
      app/src/main/java/io/legado/app/App.kt
  3. 10
      app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt
  4. 10
      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)

@ -300,10 +300,7 @@ class RuleAnalyzer(data: String, code: Boolean = false) {
val next = if (queue[pos] == '[') ']' else ')' //平衡组末尾字符
if (!chompBalanced(queue[pos], next)) throw Error(
queue.substring(
0,
start
) + "后未平衡"
queue.substring(0, start) + "后未平衡"
) //拉出一个筛选器,不平衡则报错
} while (end > pos)
@ -360,10 +357,7 @@ class RuleAnalyzer(data: String, code: Boolean = false) {
val next = if (queue[pos] == '[') ']' else ')' //平衡组末尾字符
if (!chompBalanced(queue[pos], next)) throw Error(
queue.substring(
0,
start
) + "后未平衡"
queue.substring(0, start) + "后未平衡"
) //拉出一个筛选器,不平衡则报错
} while (end > pos)

@ -13,11 +13,15 @@ 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<EVENT>(tag).post(event)
}
inline fun <reified EVENT> postEventDelay(tag: String, event: EVENT, delay: Long) {
LiveEventBus.get(tag).postDelay(event, delay)
LiveEventBus.get<EVENT>(tag).postDelay(event, delay)
}
inline fun <reified EVENT> postEventOrderly(tag: String, event: EVENT) {
LiveEventBus.get<EVENT>(tag).postOrderly(event)
}
inline fun <reified EVENT> AppCompatActivity.observeEvent(
@ -32,7 +36,6 @@ inline fun <reified EVENT> AppCompatActivity.observeEvent(
}
}
inline fun <reified EVENT> AppCompatActivity.observeEventSticky(
vararg tags: String,
noinline observer: (EVENT) -> Unit
@ -68,4 +71,3 @@ inline fun <reified EVENT> Fragment.observeEventSticky(
eventObservable<EVENT>(it).observeSticky(this, o)
}
}

Loading…
Cancel
Save