在 Day 31 分享 RecyclerView 如何载入更多之後,先来帮大家回顾之前星战的 Profile List 回传格式。
{
"count": 82,
"next": "http://swapi.dev/api/people/?page=2",
"previous": null,
"results": [
]
}
其中,next & previous 是一个网址,跟官方网站对照嫁接 API 的 domain 其实可以知道 page 就是 api 的取得页数的参数
回到 MainPresenter
先试试 page = 1 时,是不是跟原先的资料相同
val call = NetworkManager.client.profileList(1)
call.enqueue(object : NetworkCallback<ProfileListResponse>() {
override fun onSuccess(response: ProfileListResponse) {
view.showProfileList(response.results)
}
override fun onFailure(
call: Call<ProfileListResponse>,
statusCode: Int,
errorBody: ResponseBody?
) {
view.showApiError("statusCode= $statusCode & errorBody= $errorBody")
}
})
>>: RxJS 错误处理 Operators (1) - catchError / finalize / retry / retryWhen
目前已接触的DisplayObject包含了PIXI.Graphics()的图像绘制、PIXI.Te...
SPI是什麽? SPI(Serial Peripheral Interface),是一种同步的传输协...
由於目前人在美东,与台湾的时差刚好 12hr,完全可以说出:「当我在睡觉时,台湾的大家都还在认真工作...
SharedPreferences 有时候我们在应用程序会需要保存登入Session资料、个人偏好设...
今天是30天程序语言研究的第四天,研究的语言是python,今天主要学习的部分是tuple和func...