Dialog Coroutine Scope
class DialogCoroutineScope(activity: FragmentActivity, dialog: Dialog?, cancelable: Boolean, dispatcher: CoroutineDispatcher) : NetCoroutineScope, LifecycleObserver
Content copied to clipboard
自动加载对话框网络请求
开始: 显示对话框 错误: 提示错误信息, 关闭对话框 完全: 关闭对话框
Parameters
activity
对话框跟随生命周期的FragmentActivity
dialog
不使用默认的加载对话框而指定对话框
cancelable
是否允许用户取消对话框
Constructors
DialogCoroutineScope
Link copied to clipboard
fun DialogCoroutineScope(activity: FragmentActivity, dialog: Dialog? = null, cancelable: Boolean = true, dispatcher: CoroutineDispatcher = Dispatchers.Main)
Content copied to clipboard
对话框跟随生命周期的FragmentActivity
Functions
catch
Link copied to clipboard
open fun catch(block: AndroidScope.(Throwable) -> Unit = {}): AndroidScope
Content copied to clipboard
finally
Link copied to clipboard
open fun finally(block: AndroidScope.(Throwable?) -> Unit = {}): AndroidScope
Content copied to clipboard
handleError
Link copied to clipboard
launch
Link copied to clipboard
open override fun launch(block: suspend CoroutineScope.() -> Unit): NetCoroutineScope
Content copied to clipboard
preview
Link copied to clipboard
fun preview(ignore: Boolean = false, animate: Boolean = false, block: suspend CoroutineScope.() -> Unit): AndroidScope
Content copied to clipboard
"预览"作用域 该函数一般用于缓存读取, 只在第一次启动作用域时回调 该函数在作用域NetCoroutineScope.launch之前执行 函数内部所有的异常都不会被抛出, 也不会终止作用域执行
Properties
activity
Link copied to clipboard
cancelable
Link copied to clipboard
coroutineContext
Link copied to clipboard
dispatcher
Link copied to clipboard
scopeGroup
Link copied to clipboard