| |
---|
| | return; |
---|
| | } |
---|
| | if(isEdit){ |
---|
| | //編集時 |
---|
| | todosViewModel.setTodo(accountId,editBook.getBookId() ,editTodo.getYear(),editTodo.getMonth(), |
---|
| | editTodo.getDay(), editTodo.getTodoId(), title,spinner.getSelectedItemPosition(), year, month, day, token); |
---|
| | //編集前のTodoは削除 |
---|
| | todosViewModel.deleteTodo(accountId,editBook.getBookId(),editTodo.getYear(), |
---|
| | editTodo.getMonth(),editTodo.getDay(), editTodo.getTodoId(), token); |
---|
| | //編集後の年月日にTodoを追加 |
---|
| | todosViewModel.createTodo(accountId,spinner.getSelectedItemPosition(),year,month,day,title,token); |
---|
| | |
---|
| | ((MainActivity)getActivity()).backFragment(); |
---|
| | }else{ |
---|
| | //追加時 |
---|
| | todosViewModel.createTodo(accountId,spinner.getSelectedItemPosition(),year,month,day,title,token); |
---|
| | todosViewModel.createTodo(accountId,spinner.getSelectedItemPosition(),year,month,day,title ,token); |
---|
| | ((MainActivity)getActivity()).backFragment(); |
---|
| | } |
---|
| | |
---|
| | }); |
---|
| |
---|
| | |
|