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, scope: CoroutineScope = this,
context: CoroutineContext = Dispatchers.IO, context: CoroutineContext = Dispatchers.IO,
block: suspend CoroutineScope.() -> T block: suspend CoroutineScope.() -> T
): Coroutine<T> { ) = Coroutine.async(scope, context) { block() }
return Coroutine.async(scope, context) { block() }
}
override fun onBind(intent: Intent?): IBinder? { override fun onBind(intent: Intent?) = null
return null
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()

Loading…
Cancel
Save