From 32dbaa65e281ff9486da021bcda03e92ef82638d Mon Sep 17 00:00:00 2001 From: SuperMonster003 Date: Tue, 23 Dec 2025 18:49:30 +0800 Subject: [PATCH] =?UTF-8?q?6.7.0=20-=20Alpha12=20-=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=99=A8/=E4=BB=BB=E5=8A=A1=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=94=AF=E6=8C=81=E6=98=BE=E7=A4=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?/=E4=BB=BB=E5=8A=A1=E6=95=B0=E9=87=8F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changelog/lang_zh-Hans.json | 3 +- .../autojs/autojs/ui/explorer/ExplorerView.kt | 8 +- .../autojs/autojs/ui/main/task/TaskGroup.java | 2 +- .../ui/main/task/TaskListRecyclerView.java | 8 +- app/src/main/res/layout/explorer_category.xml | 127 +++++++++--------- 5 files changed, 83 insertions(+), 65 deletions(-) diff --git a/.changelog/lang_zh-Hans.json b/.changelog/lang_zh-Hans.json index 5aa06162..56b615be 100644 --- a/.changelog/lang_zh-Hans.json +++ b/.changelog/lang_zh-Hans.json @@ -1,7 +1,7 @@ { "$data": { "v6.7.0": { - "released_date": "2025/11/28", + "released_date": "2025/12/23", "feature": [ "插件中心功能, 支持插件的安装/卸载/更新等操作 (入口: 主页抽屉按钮)", "cvt 模块, 用于数据单位转换 (参阅 项目文档 > [单位转换](https://docs.autojs6.com/#/cvt))", @@ -77,6 +77,7 @@ "控制台浮动窗口内部实现进行无锁化及队列化处理以提升其参数设置效率与成功率", "控制台浮动窗口背景色彩行为相关 API (透明度/着色/基色) 更符合安卓设计规范 _[`issue #458`](http://issues.autojs6.com/458)_", "文件管理器浮动按钮展开后点击菜单项时优化菜单收起时机", + "文件管理器/任务面板支持显示文件/任务数量统计信息", "崩溃报告页面支持双指缩放调整字体大小并添加常用功能按钮", "应用启动器图标支持自适应图标特性 _[`issue #405`](http://issues.autojs6.com/405)_", "使用 LiveData 及 SharedFlow 替代已弃用的 LocalBroadcastManager", diff --git a/app/src/main/java/org/autojs/autojs/ui/explorer/ExplorerView.kt b/app/src/main/java/org/autojs/autojs/ui/explorer/ExplorerView.kt index 470d0d04..f86aca74 100644 --- a/app/src/main/java/org/autojs/autojs/ui/explorer/ExplorerView.kt +++ b/app/src/main/java/org/autojs/autojs/ui/explorer/ExplorerView.kt @@ -187,11 +187,15 @@ open class ExplorerView : ThemeColorSwipeRefreshLayout, SwipeRefreshLayout.OnRef ExplorerChangeEvent.CREATE -> { explorerItemManager.insertAtFront(event.newItem) mExplorerAdapter.notifyItemInserted(event.newItem, 0) + mExplorerAdapter.notifyItemChanged(positionOfCategoryDir) + mExplorerAdapter.notifyItemChanged(positionOfCategoryFile()) } ExplorerChangeEvent.REMOVE -> { i = explorerItemManager.remove(item) if (i >= 0) { mExplorerAdapter.notifyItemRemoved(item, i) + mExplorerAdapter.notifyItemChanged(positionOfCategoryDir) + mExplorerAdapter.notifyItemChanged(positionOfCategoryFile()) } } } @@ -1077,7 +1081,9 @@ open class ExplorerView : ThemeColorSwipeRefreshLayout, SwipeRefreshLayout.OnRef @Suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE") override fun bind(isDirCategory: Any, position: Int) { if (isDirCategory !is Boolean) return - binding.title.setText(if (isDirCategory) R.string.text_directory else R.string.text_file) + val titleRes = if (isDirCategory) R.string.text_directory else R.string.text_file + val count = if (isDirCategory) explorerItemManager.groupCount() else explorerItemManager.itemCount() + binding.title.text = "${context.getString(titleRes)} [ $count ]" mIsDir = isDirCategory if (isDirCategory && canGoUp()) { binding.goUp.visibility = VISIBLE diff --git a/app/src/main/java/org/autojs/autojs/ui/main/task/TaskGroup.java b/app/src/main/java/org/autojs/autojs/ui/main/task/TaskGroup.java index f18e03ef..531c8d88 100644 --- a/app/src/main/java/org/autojs/autojs/ui/main/task/TaskGroup.java +++ b/app/src/main/java/org/autojs/autojs/ui/main/task/TaskGroup.java @@ -39,7 +39,7 @@ public abstract class TaskGroup implements Parent { } public String getTitle() { - return mTitle; + return mTitle + " [ " + mTasks.size() + " ]"; } public abstract Context getContext(); diff --git a/app/src/main/java/org/autojs/autojs/ui/main/task/TaskListRecyclerView.java b/app/src/main/java/org/autojs/autojs/ui/main/task/TaskListRecyclerView.java index 02f53d19..ccfcdc65 100644 --- a/app/src/main/java/org/autojs/autojs/ui/main/task/TaskListRecyclerView.java +++ b/app/src/main/java/org/autojs/autojs/ui/main/task/TaskListRecyclerView.java @@ -59,7 +59,10 @@ public class TaskListRecyclerView extends ThemeColorRecyclerView { try { int i = mRunningTaskGroup.addTask(execution); if (i != -1) { - post(() -> mAdapter.notifyChildInserted(0, i)); + post(() -> { + mAdapter.notifyChildInserted(0, i); + mAdapter.notifyParentChanged(0); + }); } } catch (Exception e) { e.printStackTrace(); @@ -81,6 +84,7 @@ public class TaskListRecyclerView extends ThemeColorRecyclerView { final int i = mRunningTaskGroup.removeTask(execution); if (i >= 0) { mAdapter.notifyChildRemoved(0, i); + mAdapter.notifyParentChanged(0); } else { refresh(); } @@ -167,10 +171,12 @@ public class TaskListRecyclerView extends ThemeColorRecyclerView { void onTaskChange(ModelChange taskChange) { if (taskChange.getAction() == ModelChange.INSERT) { mAdapter.notifyChildInserted(1, mPendingTaskGroup.addTask(taskChange.getData())); + mAdapter.notifyParentChanged(1); } else if (taskChange.getAction() == ModelChange.DELETE) { final int i = mPendingTaskGroup.removeTask(taskChange.getData()); if (i >= 0) { mAdapter.notifyChildRemoved(1, i); + mAdapter.notifyParentChanged(1); } else { Log.w(LOG_TAG, "data inconsistent on change: " + taskChange); refresh(); diff --git a/app/src/main/res/layout/explorer_category.xml b/app/src/main/res/layout/explorer_category.xml index 42d63a82..38cc0ff7 100644 --- a/app/src/main/res/layout/explorer_category.xml +++ b/app/src/main/res/layout/explorer_category.xml @@ -1,76 +1,81 @@ - + + android:id="@+id/title_container" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="?selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:orientation="horizontal" + android:paddingVertical="8dp"> + android:id="@+id/arrow_icon" + android:layout_width="17dp" + android:layout_height="17dp" + android:layout_gravity="center_vertical" + android:layout_marginStart="9dp" + android:layout_marginEnd="6dp" + android:src="@drawable/ic_expanded" + android:translationY="1.2dp" + app:tint="#828384" /> + android:id="@+id/title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:text="@string/text_directory" + android:textColor="#828384" + android:textSize="13sp" /> + + android:id="@+id/go_up" + android:layout_width="32dp" + android:layout_height="match_parent" + android:layout_gravity="center_vertical" + android:background="?selectableItemBackgroundBorderless" + android:clickable="true" + android:padding="8dp" + android:layout_marginHorizontal="3dp" + android:src="@drawable/ic_dir_up" + android:focusable="true" + app:tint="#828384" /> + android:id="@+id/sort_order" + android:layout_width="32dp" + android:layout_height="match_parent" + android:layout_gravity="center_vertical" + android:background="?selectableItemBackgroundBorderless" + android:clickable="true" + android:padding="8dp" + android:layout_marginHorizontal="3dp" + android:src="@drawable/ic_ascending_order" + android:focusable="true" + app:tint="#828384" /> + android:id="@+id/sort_type" + android:layout_width="32dp" + android:layout_height="match_parent" + android:layout_gravity="center_vertical" + android:background="?selectableItemBackgroundBorderless" + android:clickable="true" + android:padding="8dp" + android:layout_marginHorizontal="3dp" + android:src="@drawable/ic_sort" + android:focusable="true" + app:tint="#828384" /> + \ No newline at end of file