From 297d840bff74e913ca2347e9ca6168a5a34d26c6 Mon Sep 17 00:00:00 2001 From: aBuild Date: Fri, 22 May 2026 17:16:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E6=A1=A3=E6=8C=89=E9=92=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=A1=AE=E8=AE=A4=E5=AF=B9=E8=AF=9D=E6=A1=86=EF=BC=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B9=E8=83=8C=E6=99=AF=E8=89=B2=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E5=B7=B2=E8=BF=87=E6=9C=9F=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 点击 ▷ 按钮弹出确认对话框,显示任务详情与排档后时间 - 确认后执行排档,取消则不做任何操作 - 排档时间不超过当前时间的列表项背景色设为浅绿色 - 新增 dialog_schedule_confirm.xml 布局文件 - 新增 colorScheduleFutureBackground 颜色资源 --- stallhelper/build.properties | 4 +- .../activities/TaskSchedulerActivity.java | 58 +++++++++++++- .../res/layout/dialog_schedule_confirm.xml | 78 +++++++++++++++++++ stallhelper/src/main/res/values/colors.xml | 2 + 4 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 stallhelper/src/main/res/layout/dialog_schedule_confirm.xml 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 @@ + + + + + + + + + + + + + + + + + +