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 46c84ff..fb5656a 100644 --- a/app/src/main/java/com/example/citrusclient/views/OtherHomeFragment.java +++ b/app/src/main/java/com/example/citrusclient/views/OtherHomeFragment.java @@ -268,8 +268,8 @@ }); booksViewModel.loadBook(accountId, token, curBookId); - todosViewModel.loadTodosByDay(accountId, curBookId, year, month, day, token); - scheduleViewModel.updateSchedulesByDayAndBookId(accountId, year, month, day, token, curBookId); +// todosViewModel.loadTodosByDay(accountId, curBookId, year, month, day, token); +// scheduleViewModel.updateSchedulesByDayAndBookId(accountId, year, month, day, token, curBookId); booksViewModel.getBook().observe(getViewLifecycleOwner(), new Observer() { @Override @@ -316,7 +316,7 @@ this.book = book; } todosViewModel.loadTodosByDay(accountId, curBookId, year, month, day, token); - scheduleViewModel.updateSchedulesByDayAndBookId(accountId, year, month, day, token, curBookId); + scheduleViewModel.updateSchedulesByDay(accountId, year, month, day, token); } private void clearTodoSchedule(MyOtherTodoshelfAdapter todoAdapter, MyOtherScheduleshelfAdapter scheduleAdapter) { @@ -387,13 +387,12 @@ holder.todoCheckBox.setChecked(todoData.getCheck()); holder.todoCheckBox.setEnabled(false); - if(book != null) { - int red = Integer.parseInt(book.getColor().substring(1, 3), 16); - int green = Integer.parseInt(book.getColor().substring(3, 5), 16); - int blue = Integer.parseInt(book.getColor().substring(5, 7), 16); - holder.todoButton.setBackgroundColor(Color.rgb(red, green, blue)); - holder.todoButton.setTextColor(Color.rgb(255 - red, 255 - green, 255 - blue)); - } + + int red = Integer.parseInt(book.getColor().substring(1, 3), 16); + int green = Integer.parseInt(book.getColor().substring(3, 5), 16); + int blue = Integer.parseInt(book.getColor().substring(5, 7), 16); + holder.todoButton.setBackgroundColor(Color.rgb(red, green, blue)); + holder.todoButton.setTextColor(Color.rgb(255 - red, 255 - green, 255 - blue)); // holder.todoButton.setOnClickListener(v -> { // ((MainActivity) activity).showFragment(new CreateTodoFragment(todoData, book)); @@ -490,7 +489,7 @@ Schedule scheduleData = this.scheduleList.get(position); holder.scheduleButton.setText(scheduleData.getTitle()); holder.scheduleButton.setText(scheduleData.getTitle() + "\n" + extractionTime(scheduleData.getStartTime(), curDate) + " ~ " + extractionTime(scheduleData.getEndTime(), curDate)); - if(book != null) { + if(book.getBookId() == scheduleData.getBookId()) { red = Integer.parseInt(book.getColor().substring(1, 3), 16); green = Integer.parseInt(book.getColor().substring(3, 5), 16); blue = Integer.parseInt(book.getColor().substring(5, 7), 16);