diff --git a/app/src/main/java/com/example/citrusclient/views/OtherHomeFragment.java b/app/src/main/java/com/example/citrusclient/views/OtherHomeFragment.java index fb5656a..85227c8 100644 --- a/app/src/main/java/com/example/citrusclient/views/OtherHomeFragment.java +++ b/app/src/main/java/com/example/citrusclient/views/OtherHomeFragment.java @@ -160,7 +160,7 @@ todoRecyclerView.setHasFixedSize(true); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(view.getContext()); todoRecyclerView.setLayoutManager(layoutManager); - MyOtherTodoshelfAdapter todoAdapter = new MyOtherTodoshelfAdapter(todoList, book, todosViewModel, getActivity()); + MyOtherTodoshelfAdapter todoAdapter = new MyOtherTodoshelfAdapter(todoList, book); todoRecyclerView.setAdapter(todoAdapter); todoAdapter.setItemWidth(dpToPx(todoWidth)); //ScheduleAdapter設定 @@ -168,7 +168,7 @@ scheduleRecyclerView.setHasFixedSize(true); RecyclerView.LayoutManager scheduleLayoutManager = new LinearLayoutManager(view.getContext()); scheduleRecyclerView.setLayoutManager(scheduleLayoutManager); - MyOtherScheduleshelfAdapter scheduleAdapter = new MyOtherScheduleshelfAdapter(scheduleList, book, curDate, getActivity()); + MyOtherScheduleshelfAdapter scheduleAdapter = new MyOtherScheduleshelfAdapter(scheduleList, book, curDate); scheduleRecyclerView.setAdapter(scheduleAdapter); scheduleAdapter.setItemWidth(dpToPx(scheduleWidth)); @@ -316,7 +316,7 @@ this.book = book; } todosViewModel.loadTodosByDay(accountId, curBookId, year, month, day, token); - scheduleViewModel.updateSchedulesByDay(accountId, year, month, day, token); + scheduleViewModel.updateSchedulesByDayAndBookId(accountId, year, month, day, token, curBookId); } private void clearTodoSchedule(MyOtherTodoshelfAdapter todoAdapter, MyOtherScheduleshelfAdapter scheduleAdapter) { @@ -343,16 +343,16 @@ class MyOtherTodoshelfAdapter extends RecyclerView.Adapter { private List todoList; private Book book; - private TodosViewModel todosViewModel; - private Context context; +// private TodosViewModel todosViewModel; +// private Context context; private int itemWidth; // アイテムの幅を保持 - MyOtherTodoshelfAdapter(List todos, Book book, TodosViewModel todosViewModel, Context context) { + MyOtherTodoshelfAdapter(List todos, Book book) { this.todoList = todos; - this.todosViewModel = todosViewModel; this.book = book; - this.context = context; +// this.todosViewModel = todosViewModel; +// this.context = context; } public void setTodos(List todos ,Book book) { @@ -449,15 +449,15 @@ private List scheduleList; Book book; - private Context context; +// private Context context; private LocalDate curDate; private int itemWidth; // アイテムの幅を保持 - MyOtherScheduleshelfAdapter(List schedules, Book book, LocalDate curDate, Context context) { + MyOtherScheduleshelfAdapter(List schedules, Book book, LocalDate curDate) { this.scheduleList = schedules; this.book = book; this.curDate = curDate; - this.context = context; +// this.context = context; } public void setSchedules(List schedules, Book book) {