From bff716897e6fc430dcdd0acf3dac42db2dfc7a19 Mon Sep 17 00:00:00 2001 From: SuperMonster003 Date: Thu, 22 Jan 2026 15:48:22 +0800 Subject: [PATCH] =?UTF-8?q?6.7.0=20-=20Alpha17=20-=20=E6=B5=AE=E5=8A=A8?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20"=E8=BF=90=E8=A1=8C=E8=84=9A=E6=9C=AC"=20?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=A2=9E=E5=8A=A0=20"=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5"=20=E8=8F=9C=E5=8D=95=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changelog/lang_zh-Hans.json | 1 + .../autojs/autojs/ui/explorer/ExplorerView.kt | 14 ++++++++-- .../autojs/ui/floating/CircularMenu.java | 27 +++++++++++++++++-- app/src/main/res/layout/explorer_category.xml | 10 +++---- app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-en/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-ko/strings.xml | 1 + app/src/main/res/values-night/colors.xml | 3 +++ app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/colors.xml | 3 +++ app/src/main/res/values/strings.xml | 1 + .../materialdialogs/MaterialDialog.java | 5 ++++ version.properties | 6 ++--- 19 files changed, 68 insertions(+), 12 deletions(-) diff --git a/.changelog/lang_zh-Hans.json b/.changelog/lang_zh-Hans.json index c8267bad..bee40794 100644 --- a/.changelog/lang_zh-Hans.json +++ b/.changelog/lang_zh-Hans.json @@ -132,6 +132,7 @@ "客户端模式连接时支持连接状态显示及管理 (修正地址/中止连接)", "服务端模式连接时支持显示已建立连接的客户端数量", "浮动按钮增强后台启动 Activity 的安全性以避免应用崩溃", + "浮动按钮 \"运行脚本\" 对话框增加 \"主页\" 菜单项", "浮动按钮 \"运行脚本\" 对话框支持最小化及状态恢复并尽最大努力保持窗口常驻或自动恢复", "使用 LiveData 及 SharedFlow 替代已弃用的 LocalBroadcastManager", "Gradle 构建脚本提升 7z 格式文件的解压效率", 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 1a1beb52..0b81a1b0 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 @@ -135,6 +135,10 @@ open class ExplorerView : ThemeColorSwipeRefreshLayout, SwipeRefreshLayout.OnRef ColorStateList.valueOf(context.getColor(R.color.explorer_file_operation_button)) } + private val mChevronIconTint by lazy { + ColorStateList.valueOf(context.getColor(R.color.explorer_category_operation_button)) + } + // Request host dialog to hide/show without losing state. // zh-CN: 请求宿主对话框隐藏/显示且不丢失状态. private var mRequestHostDialogHide: Runnable? = null @@ -349,7 +353,7 @@ open class ExplorerView : ThemeColorSwipeRefreshLayout, SwipeRefreshLayout.OnRef // # mCurrentPageState.scrollY = layoutManager.findLastCompletelyVisibleItemPosition(); currentPageState.scrollY = layoutManager.findFirstCompletelyVisibleItemPosition() } - mPageStateHistories.push(currentPageState) + saveCurrentPageIntoHistory() setCurrentPageState(ExplorerPageState(childItemGroup)) refreshCurrentPage() } @@ -515,7 +519,7 @@ open class ExplorerView : ThemeColorSwipeRefreshLayout, SwipeRefreshLayout.OnRef } fun goUp() { - mPageStateHistories.push(currentPageState) + saveCurrentPageIntoHistory() val currentPagePath = currentPage.path val nextPagePath = if (Explorers.Providers.workspace().isCurrentSampleDir(currentDirectory)) { path @@ -526,6 +530,10 @@ open class ExplorerView : ThemeColorSwipeRefreshLayout, SwipeRefreshLayout.OnRef refreshCurrentPage() } + fun saveCurrentPageIntoHistory() { + mPageStateHistories.push(currentPageState) + } + fun setDirectorySpanSize(directorySpanSize: Int) { mDirectorySpanSize = directorySpanSize } @@ -1078,6 +1086,8 @@ open class ExplorerView : ThemeColorSwipeRefreshLayout, SwipeRefreshLayout.OnRef init { setOnClickListeners() + + ImageViewCompat.setImageTintList(binding.arrowIcon, mChevronIconTint) } private fun setOnClickListeners() { diff --git a/app/src/main/java/org/autojs/autojs/ui/floating/CircularMenu.java b/app/src/main/java/org/autojs/autojs/ui/floating/CircularMenu.java index db53c4d6..a283fb84 100644 --- a/app/src/main/java/org/autojs/autojs/ui/floating/CircularMenu.java +++ b/app/src/main/java/org/autojs/autojs/ui/floating/CircularMenu.java @@ -7,6 +7,7 @@ import android.os.RemoteException; import android.text.TextUtils; import android.view.ContextThemeWrapper; import android.view.View; +import android.widget.ImageView; import androidx.annotation.NonNull; import com.afollestad.materialdialogs.MaterialDialog; import com.makeramen.roundedimageview.RoundedImageView; @@ -23,6 +24,7 @@ import org.autojs.autojs.core.pref.Pref; import org.autojs.autojs.core.record.GlobalActionRecorder; import org.autojs.autojs.core.record.Recorder; import org.autojs.autojs.model.explorer.ExplorerDirPage; +import org.autojs.autojs.model.explorer.ExplorerPage; import org.autojs.autojs.model.explorer.Explorers; import org.autojs.autojs.model.script.Scripts; import org.autojs.autojs.runtime.api.WrappedShizuku; @@ -47,6 +49,8 @@ import org.jdeferred.impl.DeferredObject; import org.jetbrains.annotations.NotNull; import java.text.MessageFormat; +import java.util.List; +import java.util.Objects; /** * Created by Stardust on Oct 18, 2017. @@ -149,6 +153,18 @@ public class CircularMenu implements LayoutInspector.CaptureAvailableListener { mScriptListDialog = new MaterialDialog.Builder(mContext) .title(R.string.text_run_script) .titleColorRes(R.color.day_night) + .options(List.of( + new MaterialDialog.OptionMenuItemSpec(mContext.getString(R.string.dialog_button_homepage), (d) -> { + String homepage = WorkingDirectoryUtils.getPath(); + ExplorerPage currentPageStatePage = mScriptListDialogExplorerView.currentPageState.getPage(); + if (currentPageStatePage != null) { + if (!Objects.equals(currentPageStatePage.getPath(), homepage)) { + mScriptListDialogExplorerView.saveCurrentPageIntoHistory(); + } + } + mScriptListDialogExplorerView.setExplorer(Explorers.workspace(), ExplorerDirPage.createRoot(homepage)); + }) + )) .customView(mScriptListDialogExplorerView, false) .backgroundColorRes(R.color.window_background) .neutralText(R.string.dialog_button_minimize) @@ -160,15 +176,22 @@ public class CircularMenu implements LayoutInspector.CaptureAvailableListener { .positiveColorRes(R.color.dialog_button_default) .onPositive((dialog, which) -> { dialog.dismiss(); - mScriptListDialog = null; - mScriptListDialogExplorerView = null; }) .cancelable(false) .autoDismiss(false) + .dismissListener((di) -> { + mScriptListDialog = null; + mScriptListDialogExplorerView = null; + }) .build(); var scriptListDialog = mScriptListDialog; + ImageView optionsView = scriptListDialog.getOptionsView(); + if (optionsView != null) { + optionsView.setImageTintList(ColorStateList.valueOf(mContext.getColor(R.color.dialog_options_button_tint))); + } + // Hide host dialog before launching Activity or showing secondary dialogs. // zh-CN: 在启动 Activity 或显示二级对话框之前隐藏宿主对话框. mScriptListDialogExplorerView.setRequestHostDialogHide(scriptListDialog::hide); diff --git a/app/src/main/res/layout/explorer_category.xml b/app/src/main/res/layout/explorer_category.xml index 38cc0ff7..71d0da06 100644 --- a/app/src/main/res/layout/explorer_category.xml +++ b/app/src/main/res/layout/explorer_category.xml @@ -26,7 +26,7 @@ android:layout_marginEnd="6dp" android:src="@drawable/ic_expanded" android:translationY="1.2dp" - app:tint="#828384" /> + app:tint="@color/explorer_category_operation_button" /> @@ -50,7 +50,7 @@ android:layout_marginHorizontal="3dp" android:src="@drawable/ic_dir_up" android:focusable="true" - app:tint="#828384" /> + app:tint="@color/explorer_category_operation_button" /> + app:tint="@color/explorer_category_operation_button" /> + app:tint="@color/explorer_category_operation_button" /> \ No newline at end of file diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 9fd45b45..20692fb2 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -1197,5 +1197,6 @@ تأخير طلب إذن التقاط الشاشة عند طلب إذن التقاط الشاشة، قد تحتوي نافذة طلب الإذن المنبثقة على حركة تلاشي عند اختفائها. إذا تم استدعاء `images.captureScreen` مباشرةً، فقد تتضمن لقطة الشاشة الناتجة محتوى نافذة طلب الإذن مما يسبب حجبًا.\n\nتضيف قيمة هذا الخيار مدة تأخير (بالمللي ثانية) قبل التقاط الشاشة مباشرةً بعد الحصول على الإذن، وذلك لتجنب مشكلة الحجب المذكورة أعلاه.\n\nينطبق هذا الخيار فقط على أول عملية التقاط بعد الحصول على الإذن؛ أما عمليات الالتقاط اللاحقة فلن تتأثر بهذه القيمة. مدة التأخير + الصفحة الرئيسية diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 3bab15b6..33aa5fa1 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -1192,5 +1192,6 @@ Screen capture permission request delay When requesting screen capture permission, the permission request window may include a fade-out animation when it disappears. If `images.captureScreen` is called immediately, the captured screenshot may contain the permission request window content and be obstructed.\n\nThe current option value adds a delay (in milliseconds) before capturing the screen immediately after permission is granted, which can be used to avoid the obstruction issue described above.\n\nThis option only applies to the first screenshot after screen capture permission is granted; subsequent screenshots are not affected by this value. Delay time + Homepage diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 30bb6378..d50c3040 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -1195,5 +1195,6 @@ Retraso de solicitud del permiso de captura de pantalla Al solicitar el permiso de captura de pantalla, la ventana de solicitud de permiso mostrada puede tener una animación de desvanecimiento al desaparecer. Si se llama a `images.captureScreen` inmediatamente, la captura obtenida puede incluir el contenido de dicha ventana y quedar obstruida.\n\nEl valor de esta opción añade un tiempo de espera (en milisegundos) antes de capturar la pantalla inmediatamente después de obtener el permiso, para evitar el problema de obstrucción descrito.\n\nEsta opción solo se aplica a la primera captura tras obtener el permiso; las capturas posteriores no se verán afectadas por este valor. Tiempo de retraso + Inicio diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 8909d8a3..1b2d6565 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1195,5 +1195,6 @@ Délai de demande d\'autorisation de capture d\'écran Lors de la demande d\'autorisation de capture d\'écran, la fenêtre de demande affichée peut comporter une animation de fondu lors de sa disparition. Si `images.captureScreen` est appelé immédiatement, la capture obtenue peut contenir le contenu de cette fenêtre et être partiellement masquée.\n\nLa valeur de cette option ajoute un délai (en millisecondes) avant d\'effectuer la capture juste après l\'obtention de l\'autorisation, afin d\'éviter le problème de masquage ci-dessus.\n\nCette option ne s\'applique qu\'à la première capture après l\'obtention de l\'autorisation ; les captures suivantes ne seront plus affectées par cette valeur. Délai + Accueil diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 9b12a14e..d108ba09 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -1196,5 +1196,6 @@ 画面キャプチャ権限リクエスト遅延 画面キャプチャ権限を要求する際, 表示される権限リクエスト画面が閉じるときにフェード等のアニメーションが発生する場合があります. この直後に `images.captureScreen` を呼び出すと, 取得したスクリーンショットに権限リクエスト画面の内容が写り込み, 遮蔽が発生することがあります. \n\nこの設定値は, 権限取得直後に最初のスクリーンショットを取得する前に遅延時間(ミリ秒)を追加し, 上記の遮蔽問題を回避するために使用します. \n\nこの設定は権限取得後の最初のスクリーンショットにのみ適用され, 以降のスクリーンショットには影響しません. 遅延時間 + ホームページ diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 368bb7f4..1fe67acc 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -1197,5 +1197,6 @@ 화면 캡처 권한 요청 지연 화면 캡처 권한을 요청할 때 표시되는 권한 요청 창은 사라질 때 페이드 등의 전환 애니메이션이 있을 수 있습니다. 이때 `images.captureScreen` 메서드를 즉시 호출하면, 얻은 스크린샷에 권한 요청 창의 내용이 포함되어 화면이 가려질 수 있습니다.\n\n이 설정 값은 권한을 획득한 직후 첫 스크린샷을 캡처하기 전에 지연 시간(밀리초)을 추가하여, 위와 같은 가림 문제를 방지하는 데 사용할 수 있습니다.\n\n이 설정은 권한 획득 후 첫 번째 캡처에만 적용되며, 이후 캡처에는 더 이상 영향을 주지 않습니다. 지연 시간 + 홈페이지 diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 92d10195..401bab09 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -42,6 +42,8 @@ #4FC3F7 @color/dialog_button_error + #DEA9A9A9 + #333333 @color/dawn_full @@ -73,6 +75,7 @@ #808080 @color/md_gray_600 + @color/md_gray_500 #A9AAAB #A9AAAB diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 9d868d9f..032ab5c0 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -1195,5 +1195,6 @@ Задержка запроса разрешения на захват экрана При запросе разрешения на захват экрана отображаемое окно запроса может иметь анимацию затухания при исчезновении. Если сразу вызвать `images.captureScreen`, полученный снимок может содержать содержимое этого окна и быть частично перекрыт.\n\nЗначение этой опции добавляет задержку (в миллисекундах) перед выполнением снимка экрана сразу после получения разрешения, что позволяет избежать описанной выше проблемы перекрытия.\n\nЭта опция применяется только к первому снимку после получения разрешения; последующие снимки не будут зависеть от этого значения. Время задержки + Главная diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 7d2ca5c5..878bf437 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -1193,5 +1193,6 @@ 屏幕捕獲權限申請延遲 申請屏幕捕獲權限時, 彈出的權限申請窗口消失時可能存在漸變動畫, 此時如果立即調用 `images.captureScreen` 方法, 獲取的屏幕截圖中會出現權限申請的窗口內容而造成遮擋.\n\n當前設置選項值用於在截圖權限申請後立即獲取屏幕截圖前增加一個延遲時間 (單位為毫秒), 可用於避免上述遮擋問題.\n\n當前設置選項僅適用於獲取截圖權限後的首次截圖操作, 後續截圖操作不再受此設置值影響. 延遲時間 + 主頁 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 924d45e1..665a753c 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1193,5 +1193,6 @@ 螢幕捕獲許可權申請延遲 申請螢幕捕獲許可權時, 彈出的許可權申請視窗消失時可能存在漸變動畫, 此時如果立即呼叫 `images.captureScreen` 方法, 獲取的螢幕截圖中會出現許可權申請的視窗內容而造成遮擋.\n\n當前設定選項值用於在截圖許可權申請後立即獲取螢幕截圖前增加一個延遲時間 (單位為毫秒), 可用於避免上述遮擋問題.\n\n當前設定選項僅適用於獲取截圖許可權後的首次截圖操作, 後續截圖操作不再受此設定值影響. 延遲時間 + 主頁 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 7ee9c2be..2315af73 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1193,5 +1193,6 @@ 屏幕捕获权限申请延迟 申请屏幕捕获权限时, 弹出的权限申请窗口消失时可能存在渐变动画, 此时如果立即调用 `images.captureScreen` 方法, 获取的屏幕截图中会出现权限申请的窗口内容而造成遮挡.\n\n当前设置选项值用于在截图权限申请后立即获取屏幕截图前增加一个延迟时间 (单位为毫秒), 可用于避免上述遮挡问题.\n\n当前设置选项仅适用于获取截图权限后的首次截图操作, 后续截图操作不再受此设置值影响. 延迟时间 + 主页 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index c73ec4a6..896efa75 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -121,6 +121,8 @@ #DCEDC8 #00C853 + @color/day + #FAFAFA #FAFAFA @@ -170,6 +172,7 @@ #9DA0A2 #A9AAAB + #828384 #606366 #606366 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 04236cdc..93b21a10 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1451,5 +1451,6 @@ Screen capture permission request delay When requesting screen capture permission, the permission request window may include a fade-out animation when it disappears. If `images.captureScreen` is called immediately, the captured screenshot may contain the permission request window content and be obstructed.\n\nThe current option value adds a delay (in milliseconds) before capturing the screen immediately after permission is granted, which can be used to avoid the obstruction issue described above.\n\nThis option only applies to the first screenshot after screen capture permission is granted; subsequent screenshots are not affected by this value. Delay time + Homepage diff --git a/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java index 9836e162..755f6da9 100644 --- a/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java +++ b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java @@ -506,6 +506,11 @@ public class MaterialDialog extends DialogBase implements View.OnClickListener, return content; } + @Nullable + public final ImageView getOptionsView() { + return optionsView; + } + /** * Retrieves the custom view that was inflated or set to the MaterialDialog during building. * diff --git a/version.properties b/version.properties index 9c975c95..aabdf598 100644 --- a/version.properties +++ b/version.properties @@ -1,5 +1,5 @@ -#Thu Jan 22 00:50:41 CST 2026 -BUILD_TIME=1769014241677 +#Thu Jan 22 15:46:07 CST 2026 +BUILD_TIME=1769067967886 COMPILE_SDK_VERSION=36 IMAGE_QUANT_CMAKE_VERSION=3.22.1 IMAGE_QUANT_NDK_VERSION=26.1.10909125 @@ -27,6 +27,6 @@ RAPID_OCR_OPENCV_MOBILE_LABEL_VERSION=13 RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3 TARGET_SDK_VERSION=36 TARGET_SDK_VERSION_INRT=29 -VERSION_BUILD=3645 +VERSION_BUILD=3647 VERSION_NAME=6.7.0 Alpha17 VSCODE_EXT_REQUIRED_VERSION=1.0.13