From 4916c05b0888e604a54634fdfcf112140453dc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Tue, 23 Jul 2024 12:00:10 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8A=B9=E7=8E=87=E5=8C=96,=20=E3=83=AA?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=AF=E3=82=BF,=20=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/kidshift/wallet/HistoryItemListAdapter.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/feature/wallet/src/main/java/one/nem/kidshift/wallet/HistoryItemListAdapter.java b/feature/wallet/src/main/java/one/nem/kidshift/wallet/HistoryItemListAdapter.java index 95f5292..7e73a25 100644 --- a/feature/wallet/src/main/java/one/nem/kidshift/wallet/HistoryItemListAdapter.java +++ b/feature/wallet/src/main/java/one/nem/kidshift/wallet/HistoryItemListAdapter.java @@ -156,16 +156,20 @@ public class HistoryItemListAdapter extends RecyclerView.Adapter { - // TODO: 一括で外すことも出来るように - // 判定が変わるまで全部チェックする + // 次のヘッダーまでの間のアイテムを全てチェックする + int index = position + 1; try { - int index = historyDataList.getList().indexOf(historyData); while (!isFirstOfMonth(this.historyDataList.getList().get(index))) { this.historyDataList.getList().get(index).setChecked(true); index++; } + // 自身を更新 Workaround: なぜかindexを+1しないとチェックをつけれないので + this.historyDataList.getList().get(position).setChecked(true); + // 表示更新 + notifyItemRangeChanged(position, index - position); +// notifyDataSetChanged(); } catch (IndexOutOfBoundsException e) { - // 1個しかない場合? Workaround + // 1個しかない場合 Workaround } }); }