mirror of
https://gitea.winboll.cc/ZhanGSKen/MyWinBoLL.git
synced 2026-08-15 05:52:09 +08:00
修复任务排档performSchedule逻辑:排档时间应更新当前任务而非下一任务
- performSchedule 改为将新时间设置给当前任务自身 - 添加 notifyItemChanged(position) 刷新当前列表项 - 补充 saveTaskData() 持久化数据
This commit is contained in:
+4
-6
@@ -484,12 +484,10 @@ public class TaskSchedulerActivity extends WinBoLLActivity {
|
||||
int duration = currentTask.getDurationMinutes();
|
||||
long newTime = currentTime + duration * 60 * 1000L;
|
||||
LogUtils.i(TAG, "performSchedule: 当前时间 " + formatTimestamp(currentTime) + " + " + duration + "分钟 = " + formatTimestamp(newTime));
|
||||
if (position + 1 < mTaskList.size()) {
|
||||
TaskSchedulerBean nextTask = mTaskList.get(position + 1);
|
||||
nextTask.setCurrentScheduleTime(newTime);
|
||||
mAdapter.notifyItemChanged(position + 1);
|
||||
LogUtils.i(TAG, "performSchedule: 更新任务 [" + nextTask.getTaskName() + "] 时间更新为 " + formatTimestamp(newTime));
|
||||
}
|
||||
currentTask.setCurrentScheduleTime(newTime);
|
||||
mAdapter.notifyItemChanged(position);
|
||||
saveTaskData();
|
||||
LogUtils.i(TAG, "performSchedule: 更新任务 [" + currentTask.getTaskName() + "] 时间更新为 " + formatTimestamp(newTime));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user