StateCallback

abstract class StateCallback<T>(state: StateLayout) : NetCallback<T>

配合SateLayout布局使用 会在加载成功/错误时显示对应的缺省页 会在页面被销毁时自动取消网络请求

Constructors

StateCallback
Link copied to clipboard
fun StateCallback(state: StateLayout)

Functions

onComplete
Link copied to clipboard
open override fun onComplete(call: Call, e: Throwable?)
网络请求完成
onError
Link copied to clipboard
open override fun onError(call: Call, e: IOException)
网络请求完成
onFailure
Link copied to clipboard
open override fun onFailure(call: Call, e: IOException)
网络请求失败, 异步线程
onStart
Link copied to clipboard
open override fun onStart(request: Request)
网络请求开始

Properties

state
Link copied to clipboard
val state: StateLayout