| | |
| | | import java.util.Objects; |
| | | |
| | | import cn.flightfeather.thirdapp.R; |
| | | import cn.flightfeather.thirdapp.bean.Subtask; |
| | | import cn.flightfeather.thirdapp.bean.entity.Subtask; |
| | | import cn.flightfeather.thirdapp.util.Constant; |
| | | import cn.flightfeather.thirdapp.util.DialogUtil2; |
| | | import cn.flightfeather.thirdapp.util.Domain; |
| | |
| | | |
| | | @Override |
| | | public void onBindViewHolder(TaskListHolder holder, final int position) { |
| | | int pos = holder.getAdapterPosition(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm", Locale.getDefault()); |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("MM月dd日", Locale.getDefault()); |
| | | Subtask subTask = subTaskList.get(position); |
| | | Subtask subTask = subTaskList.get(pos); |
| | | switch (holder.getItemViewType()) { |
| | | case ITEM_VIEW_TYPE_HEAD: |
| | | Date date1 = subTask.getPlanstarttime(); |
| | |
| | | holder.mtv_time.setText(planStartTime); |
| | | |
| | | //对是否显示日期的判断 |
| | | if (position>0){ |
| | | Subtask subTaskBefore = subTaskList.get(position-1); |
| | | if (pos>0){ |
| | | Subtask subTaskBefore = subTaskList.get(pos-1); |
| | | Calendar calendarBefore = Calendar.getInstance(); |
| | | calendarBefore.setTime(subTaskBefore.getPlanstarttime()); |
| | | calendarBefore.set(Calendar.HOUR_OF_DAY,0); |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (onSwipeItemClickListener != null) { |
| | | onSwipeItemClickListener.click(position); |
| | | onSwipeItemClickListener.click(pos); |
| | | } |
| | | } |
| | | }); |
| | |
| | | @Override |
| | | public boolean onLongClick(View v) { |
| | | DialogUtil2.INSTANCE.showAlertDialog(context, "确认是否删除任务?", dialog -> { |
| | | onDeleteListener.delete(position); |
| | | onDeleteListener.delete(pos); |
| | | dialog.dismiss(); |
| | | return Unit.INSTANCE; |
| | | }, dialog -> { |