6.7.0 - Alpha12 - 文件管理器/任务面板支持显示文件/任务数量统计信息
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -39,7 +39,7 @@ public abstract class TaskGroup implements Parent<Task> {
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return mTitle;
|
||||
return mTitle + " [ " + mTasks.size() + " ]";
|
||||
}
|
||||
|
||||
public abstract Context getContext();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -21,8 +22,10 @@
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginHorizontal="9dp"
|
||||
android:layout_marginStart="9dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:src="@drawable/ic_expanded"
|
||||
android:translationY="1.2dp"
|
||||
app:tint="#828384" />
|
||||
|
||||
<TextView
|
||||
@@ -33,6 +36,7 @@
|
||||
android:text="@string/text_directory"
|
||||
android:textColor="#828384"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
@@ -73,4 +77,5 @@
|
||||
android:src="@drawable/ic_sort"
|
||||
android:focusable="true"
|
||||
app:tint="#828384" />
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user