From 355fe5e9ae625ffbab12d219f7e15a81ddf801d2 Mon Sep 17 00:00:00 2001 From: daigorian Date: Wed, 7 Jul 2021 20:37:58 +0900 Subject: [PATCH] =?UTF-8?q?EPGStation=20V2.x.x=20=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E3=81=A8=E3=81=8D?= =?UTF-8?q?=20=E9=8C=B2=E7=94=BB=E3=83=AB=E3=83=BC=E3=83=AB=E3=81=8C=2024?= =?UTF-8?q?=E5=80=8B(=3D1=E3=83=9A=E3=83=BC=E3=82=B8=E7=9B=AE)=E3=81=BE?= =?UTF-8?q?=E3=81=A7=E3=81=97=E3=81=8B=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/daigorian/epcltvapp/MainFragment.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/daigorian/epcltvapp/MainFragment.kt b/app/src/main/java/com/daigorian/epcltvapp/MainFragment.kt index 920e92a..eb7f775 100644 --- a/app/src/main/java/com/daigorian/epcltvapp/MainFragment.kt +++ b/app/src/main/java/com/daigorian/epcltvapp/MainFragment.kt @@ -244,7 +244,7 @@ class MainFragment : BrowseSupportFragment() { Toast.makeText(context!!, R.string.connect_epgstation_failed, Toast.LENGTH_LONG).show() } }) - EpgStationV2.api?.getRules()?.enqueue(object : Callback { + EpgStationV2.api?.getRules(limit=Int.MAX_VALUE)?.enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { response.body()?.rules?.forEach { rule -> @@ -515,11 +515,11 @@ class MainFragment : BrowseSupportFragment() { hasOriginalFile = item.hasOriginalFile )?.enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { - response.body()?.let { response -> + response.body()?.let { responseRoot -> //APIのレスポンスをひとつづつアイテムとして加える。最初のアイテムだけ、Loadingアイテムを置き換える //先にremoveしてaddすると高速でスクロールさせたときに描画とremoveがぶつかって落ちるのであえてreplaceに。 - response.records.forEachIndexed { index, recordedProgram -> + responseRoot.records.forEachIndexed { index, recordedProgram -> if(index == 0) { adapter.replace(adapter.indexOf(item),recordedProgram) }else{ @@ -527,8 +527,8 @@ class MainFragment : BrowseSupportFragment() { } } //続きがあるなら"次を読み込む"を置く。 - val numOfItem = response.records.count().toLong() + item.offset - if (numOfItem < response.total) { + val numOfItem = responseRoot.records.count().toLong() + item.offset + if (numOfItem < responseRoot.total) { adapter.add(item.copy(offset = numOfItem)) }