TextView書き換えテスト

This commit is contained in:
ろむねこ 2024-07-23 11:17:28 +09:00
parent dc83d541e2
commit 9a8d9ef631
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -131,7 +131,7 @@ public class HistoryItemListAdapter extends RecyclerView.Adapter<HistoryItemList
view.addView(LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_history_month_header, parent, false)); view.addView(LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_history_month_header, parent, false));
view.addView(LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_history_list_item, parent, false)); view.addView(LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_history_list_item, parent, false));
return new ViewHolder(view); return new MonthHeaderViewHolder(view);
} else { } else {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_history_list_item, parent, false); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_history_list_item, parent, false);
return new ViewHolder(view); return new ViewHolder(view);
@ -149,6 +149,11 @@ public class HistoryItemListAdapter extends RecyclerView.Adapter<HistoryItemList
historyData.setChecked(isChecked); historyData.setChecked(isChecked);
} }
}); });
if (holder instanceof MonthHeaderViewHolder) {
// ((MonthHeaderViewHolder) holder).monthHeaderTextView.setText(historyData.getRegisteredAt().getMonth() + "");
// DEBUG: 月をまたぐデータがないので
((MonthHeaderViewHolder) holder).monthHeaderTextView.setText(historyData.getRegisteredAt().getDate() + "");
}
} }
private boolean isFirstOfMonth(HistoryModel historyModel) { private boolean isFirstOfMonth(HistoryModel historyModel) {