diff --git a/app/src/main/java/org/autojs/autojs/core/accessibility/NodeInfo.kt b/app/src/main/java/org/autojs/autojs/core/accessibility/NodeInfo.kt index 26cf7632d..1a2a27c9d 100644 --- a/app/src/main/java/org/autojs/autojs/core/accessibility/NodeInfo.kt +++ b/app/src/main/java/org/autojs/autojs/core/accessibility/NodeInfo.kt @@ -63,6 +63,7 @@ class NodeInfo(private val resources: Resources?, private val node: UiObject, va val columnSpan = node.columnSpan() val drawingOrder = node.drawingOrder val actionNames = node.actionNames() + var hidden = false val children = ArrayList() diff --git a/app/src/main/java/org/autojs/autojs/ui/floating/LayoutFloatyWindow.kt b/app/src/main/java/org/autojs/autojs/ui/floating/LayoutFloatyWindow.kt index 76e700619..ff69b110b 100644 --- a/app/src/main/java/org/autojs/autojs/ui/floating/LayoutFloatyWindow.kt +++ b/app/src/main/java/org/autojs/autojs/ui/floating/LayoutFloatyWindow.kt @@ -16,6 +16,7 @@ import org.autojs.autojs.core.accessibility.WindowInfo.Companion.WindowInfoRootN import org.autojs.autojs.core.accessibility.WindowInfo.Companion.parseWindowType import org.autojs.autojs.ui.enhancedfloaty.FloatyService import org.autojs.autojs.ui.floating.layoutinspector.LayoutBoundsFloatyWindow +import org.autojs.autojs.ui.floating.layoutinspector.LayoutBoundsView import org.autojs.autojs.ui.floating.layoutinspector.LayoutHierarchyFloatyWindow import org.autojs.autojs.ui.floating.layoutinspector.NodeInfoView import org.autojs.autojs.ui.widget.BubblePopupMenu @@ -128,4 +129,18 @@ abstract class LayoutFloatyWindow( } } + + protected fun excludeNode() { + mLayoutSelectedNode?.let { + it.hidden = true + mLayoutSelectedNode = null + } + } + + protected fun excludeAllBoundsSameNode(layoutBoundsView: LayoutBoundsView ) { + mLayoutSelectedNode?.let { + layoutBoundsView.hideAllBoundsSameNode(it) + mLayoutSelectedNode = null + } + } } \ No newline at end of file diff --git a/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/LayoutBoundsFloatyWindow.kt b/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/LayoutBoundsFloatyWindow.kt index e20028f0c..e56e7323a 100644 --- a/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/LayoutBoundsFloatyWindow.kt +++ b/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/LayoutBoundsFloatyWindow.kt @@ -27,6 +27,8 @@ open class LayoutBoundsFloatyWindow @JvmOverloads constructor( R.string.text_show_layout_hierarchy to ::showLayoutHierarchy, R.string.text_generate_code to ::generateCode, R.string.text_switch_window to ::switchWindow, + R.string.text_hide_node to ::excludeNode, + R.string.text_hide_same_frame_nodes to ::excludeAllBoundsSameNode, R.string.text_exit to ::close, ) @@ -69,4 +71,7 @@ open class LayoutBoundsFloatyWindow @JvmOverloads constructor( } } + private fun excludeAllBoundsSameNode() { + excludeAllBoundsSameNode(mLayoutBoundsView) + } } \ No newline at end of file diff --git a/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/LayoutBoundsView.kt b/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/LayoutBoundsView.kt index a474838af..089f66ef3 100644 --- a/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/LayoutBoundsView.kt +++ b/app/src/main/java/org/autojs/autojs/ui/floating/layoutinspector/LayoutBoundsView.kt @@ -63,6 +63,28 @@ open class LayoutBoundsView : View { mTouchedNode = null } + fun hideAllBoundsSameNode(targetNode: NodeInfo?) { + if (mRootNode == null || targetNode == null) { + return + } + hideNodes(mRootNode, targetNode) + } + + private fun hideNodes(parent: NodeInfo?, targetNode: NodeInfo) { + if (parent == null) { + return + } + if (parent.boundsInScreen == targetNode.boundsInScreen) { + parent.hidden = true + } + if (parent.children.size == 0) { + return + } + for (child in parent.children) { + hideNodes(child, targetNode) + } + } + override fun onDraw(canvas: Canvas) { super.onDraw(canvas) if (mBoundsInScreen == null) { @@ -93,7 +115,9 @@ open class LayoutBoundsView : View { private fun draw(canvas: Canvas, node: NodeInfo?) { if (node == null) return - drawRect(canvas, node.boundsInScreen, statusBarHeight, boundsPaint) + if (!node.hidden) { + drawRect(canvas, node.boundsInScreen, statusBarHeight, boundsPaint) + } for (child in node.children) { draw(canvas, child) } @@ -125,7 +149,9 @@ open class LayoutBoundsView : View { private fun findNodeAt(node: NodeInfo, x: Int, y: Int, list: MutableList) { for (child in node.children) { if (child.boundsInScreen.contains(x, y)) { - list.add(child) + if (!child.hidden) { + list.add(child) + } findNodeAt(child, x, y, list) } } diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 1d771f881..d8fee196c 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -993,5 +993,7 @@ إعدادات النظام الآمنة ، التي تحتوي على تفضيلات النظام التي يمكن أن تقرأها التطبيقات ولكن لا يُسمح لها بالكتابة.\nهذه هي لتفضيلات يجب على المستخدم تعديلها بشكل صريح من خلال واجهة المستخدم لتطبيق النظام.\nمع إذن إعدادات النظام الآمن ، يمكن للتطبيقات العادية تعديل الإعدادات الآمنة مباشرة (مثل خدمة إمكانية الوصول). كتابة إعدادات النظام المسار المُحلّ لـ \"%1$s\" لا يمكن أن يكون null + إخفاء هذه العقدة + إخفاء العقدة ذات الإطار المماثل diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 257f641f4..5548b83e1 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -988,5 +988,7 @@ Secure system settings, containing system preferences that applications can read but are not allowed to write.\nThese are for preferences that the user must explicitly modify through the UI of a system app.\nWith secure system settings permission, normal applications can directly modify the secure settings (such as accessibility service). Write system settings Resolved path for \"%1$s\" cannot be null + Hide this node + Hide same frame nodes diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index c2156db62..3a04ec10f 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -991,5 +991,7 @@ Ajustes de seguridad del sistema, que contienen preferencias del sistema que las aplicaciones pueden leer pero no pueden escribir.\nSe trata de preferencias que el usuario debe modificar explícitamente a través de la interfaz de usuario de una aplicación del sistema.\nCon el permiso de configuración segura del sistema, las aplicaciones normales pueden modificar directamente la configuración segura (como el servicio de accesibilidad). Escribir la configuración del sistema La ruta resuelta para \"%1$s\" no puede ser nula + Ocultar este nodo + Ocultar nodo del mismo marco diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index baeedd572..26f657444 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -991,5 +991,7 @@ Paramètres de sécurité du système, contenant les préférences du système que les applications peuvent lire mais ne sont pas autorisées à écrire.\nIl s\'agit des préférences que l\'utilisateur doit explicitement modifier par le biais de l\'interface utilisateur d\'une application système.\nAvec l\'autorisation de paramètres de sécurité du système, les applications normales peuvent directement modifier les paramètres de sécurité (comme le service d\'accessibilité). Écrire les paramètres système Le chemin résolu pour \"%1$s\" ne peut pas être nul + Masquer ce nœud + Masquer le nœud du même cadre diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index b3ca5fd9e..ffe4ce459 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -992,5 +992,7 @@ アプリケーションが読み取ることはできるが, 書き込むことはできないシステム環境設定を含む, 安全なシステム設定です.\nこれは, ユーザーがシステムアプリの UI を通じて明示的に変更する必要がある環境設定のためのものです.\nセキュアなシステム設定を許可すると, 通常のアプリケーションはセキュアな設定 (アクセシビリティサービスなど) を直接変更できるようになります システム設定の書き込み \"%1$s\" の解決済みパスは null にできません + このノードを隠す + 同じフレームのノードを隠す diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 07f6ad151..c72b05d9e 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -993,5 +993,7 @@ 애플리케이션이 읽을 수 있지만 쓸 수없는 시스템 환경 설정을 포함하는 보안 시스템 설정.\n이들은 사용자가 시스템 앱의 UI 를 통해 명시 적으로 수정 해야하는 선호도입니다.\n보안 시스템 설정 권한을 사용하면 일반 애플리케이션이 보안 설정 (예: 접근성 서비스)을 직접 수정할 수 있습니다. 시스템 설정을 작성하십시오 \"%1$s\" 에 대한 해결된 경로는 null 일 수 없습니다 + 이 노드를 숨기기 + 동일 프레임의 노드를 숨기기 diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index b77c77e34..7a7eebe2d 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -991,5 +991,7 @@ Настройки безопасности системы, содержащие системные предпочтения, которые приложения могут читать, но не имеют права записывать.\nОни предназначены для параметров, которые пользователь должен явно изменить через пользовательский интерфейс системного приложения.\nПри наличии разрешения на безопасные системные настройки обычные приложения могут напрямую изменять безопасные настройки (например, служба доступности). Запись системных настроек Разрешённый путь для \"%1$s\" не может быть равен null + Скрыть этот узел + Скрыть узел того же фрейма diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 36a2ad6ed..fed009873 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -989,5 +989,7 @@ 安全設置包含應用程序可讀但不可寫入的設置選項, 這些選項只能由 UI 或系統級別應用修改.\n被授予 \"修改安全設置權限\" 後, 普通應用可直接修改上述安全設置 (例如無障礙服務). 修改系統設置 解析後的路徑 \"%1$s\" 不可為 null + 隱藏此節點 + 隱藏同框節點 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 95112c91c..03f3dc987 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -989,5 +989,7 @@ 安全設定包含應用程式可讀但不可寫入的設定選項, 這些選項只能由 UI 或系統級別應用修改.\n被授予 \"修改安全設定許可權\" 後, 普通應用可直接修改上述安全設定 (例如無障礙服務). 修改系統設定 解析後的路徑 \"%1$s\" 不可為 null + 隱藏此節點 + 隱藏同框節點 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 7ddaa395f..bdeab46fe 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -989,5 +989,7 @@ 安全设置包含应用程序可读但不可写入的设置选项, 这些选项只能由 UI 或系统级别应用修改.\n被授予 \"修改安全设置权限\" 后, 普通应用可直接修改上述安全设置 (例如无障碍服务). 修改系统设置 解析后的路径 \"%1$s\" 不可为 null + 隐藏此节点 + 隐藏同框节点 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 556b2a7c8..301f69a83 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1218,5 +1218,7 @@ Secure system settings, containing system preferences that applications can read but are not allowed to write.\nThese are for preferences that the user must explicitly modify through the UI of a system app.\nWith secure system settings permission, normal applications can directly modify the secure settings (such as accessibility service). Write system settings Resolved path for \"%1$s\" cannot be null + Hide this node + Hide same frame nodes