diff --git a/stallhelper/build.properties b/stallhelper/build.properties index 4620da9..739ff43 100644 --- a/stallhelper/build.properties +++ b/stallhelper/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Fri May 22 16:56:04 HKT 2026 +#Fri May 22 17:09:32 HKT 2026 stageCount=4 libraryProject= baseVersion=15.20 publishVersion=15.20.3 -buildCount=11 +buildCount=14 baseBetaVersion=15.20.4 diff --git a/stallhelper/src/main/java/cc/winboll/studio/stallhelper/activities/TaskSchedulerActivity.java b/stallhelper/src/main/java/cc/winboll/studio/stallhelper/activities/TaskSchedulerActivity.java index 49a9dd1..21a0b4b 100644 --- a/stallhelper/src/main/java/cc/winboll/studio/stallhelper/activities/TaskSchedulerActivity.java +++ b/stallhelper/src/main/java/cc/winboll/studio/stallhelper/activities/TaskSchedulerActivity.java @@ -516,6 +516,56 @@ public class TaskSchedulerActivity extends WinBoLLActivity { dialog.show(); } + /** + * 显示排档确认对话框 + * @param position 要排档的任务位置 + */ + private void showScheduleConfirmDialog(final int position) { + if (position < 0 || position >= mTaskList.size()) { + return; + } + + final TaskSchedulerBean task = mTaskList.get(position); + long currentTime = task.getCurrentScheduleTime(); + int duration = task.getDurationMinutes(); + long newTime = currentTime + duration * 60 * 1000L; + + final Dialog dialog = new Dialog(this); + dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); + dialog.setContentView(R.layout.dialog_schedule_confirm); + + TextView tvTaskName = dialog.findViewById(R.id.dialog_schedule_task_name); + TextView tvCurrentTime = dialog.findViewById(R.id.dialog_schedule_current_time); + TextView tvDuration = dialog.findViewById(R.id.dialog_schedule_duration); + TextView tvRemark = dialog.findViewById(R.id.dialog_schedule_remark); + TextView tvNewTime = dialog.findViewById(R.id.dialog_schedule_new_time); + Button btnCancel = dialog.findViewById(R.id.dialog_btn_cancel); + Button btnConfirm = dialog.findViewById(R.id.dialog_btn_confirm); + + tvTaskName.setText("任务:" + task.getTaskName()); + tvCurrentTime.setText("当前排档时间:" + formatTimestamp(currentTime)); + tvDuration.setText("排档幅度:" + formatDurationToString(duration)); + tvRemark.setText("备注:" + (task.getRemark() != null && !task.getRemark().isEmpty() ? task.getRemark() : "无")); + tvNewTime.setText("排档后时间:" + formatTimestamp(newTime)); + + btnCancel.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + dialog.dismiss(); + } + }); + + btnConfirm.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + dialog.dismiss(); + performSchedule(position); + } + }); + + dialog.show(); + } + /** * 执行排档操作 * @param position 点击排档按钮的任务位置 @@ -562,6 +612,12 @@ public class TaskSchedulerActivity extends WinBoLLActivity { viewHolder.mtvDuration.setText(formatDurationToString(item.getDurationMinutes())); viewHolder.mtvRemark.setText(item.getRemark()); + if (item.getCurrentScheduleTime() <= System.currentTimeMillis()) { + viewHolder.mllMain.setBackgroundResource(R.color.colorScheduleFutureBackground); + } else { + viewHolder.mllMain.setBackgroundResource(R.drawable.bg_frame); + } + // 长按直接内置菜单,直接使用当前position viewHolder.mllMain.setOnLongClickListener(new View.OnLongClickListener() { @Override @@ -593,7 +649,7 @@ public class TaskSchedulerActivity extends WinBoLLActivity { viewHolder.mbtnSchedule.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - performSchedule(position); + showScheduleConfirmDialog(position); } }); } diff --git a/stallhelper/src/main/res/layout/dialog_schedule_confirm.xml b/stallhelper/src/main/res/layout/dialog_schedule_confirm.xml new file mode 100644 index 0000000..3c89156 --- /dev/null +++ b/stallhelper/src/main/res/layout/dialog_schedule_confirm.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + +