BaseService.kt: Modify functions into assigning style

Signed-off-by: 1552980358 <1552980358@qq.com>
pull/368/head
1552980358 4 years ago
parent f3b72d8c1c
commit 8a8df59e21
  1. 8
      app/src/main/java/io/legado/app/base/BaseService.kt

@ -16,13 +16,9 @@ abstract class BaseService : Service(), CoroutineScope by MainScope() {
scope: CoroutineScope = this,
context: CoroutineContext = Dispatchers.IO,
block: suspend CoroutineScope.() -> T
): Coroutine<T> {
return Coroutine.async(scope, context) { block() }
}
) = Coroutine.async(scope, context) { block() }
override fun onBind(intent: Intent?): IBinder? {
return null
}
override fun onBind(intent: Intent?) = null
override fun onDestroy() {
super.onDestroy()

Loading…
Cancel
Save