这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<NodeInfo>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down Expand Up @@ -69,4 +71,7 @@ open class LayoutBoundsFloatyWindow @JvmOverloads constructor(
}
}

private fun excludeAllBoundsSameNode() {
excludeAllBoundsSameNode(mLayoutBoundsView)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -125,7 +149,9 @@ open class LayoutBoundsView : View {
private fun findNodeAt(node: NodeInfo, x: Int, y: Int, list: MutableList<NodeInfo>) {
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)
}
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -993,5 +993,7 @@
<string name="text_write_secure_settings_description">إعدادات النظام الآمنة ، التي تحتوي على تفضيلات النظام التي يمكن أن تقرأها التطبيقات ولكن لا يُسمح لها بالكتابة.\nهذه هي لتفضيلات يجب على المستخدم تعديلها بشكل صريح من خلال واجهة المستخدم لتطبيق النظام.\nمع إذن إعدادات النظام الآمن ، يمكن للتطبيقات العادية تعديل الإعدادات الآمنة مباشرة (مثل خدمة إمكانية الوصول).</string>
<string name="text_write_system_settings">كتابة إعدادات النظام</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">المسار المُحلّ لـ \"%1$s\" لا يمكن أن يكون null</string>
<string name="text_hide_node">إخفاء هذه العقدة</string>
<string name="text_hide_same_frame_nodes">إخفاء العقدة ذات الإطار المماثل</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -988,5 +988,7 @@
<string name="text_write_secure_settings_description">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).</string>
<string name="text_write_system_settings">Write system settings</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">Resolved path for \"%1$s\" cannot be null</string>
<string name="text_hide_node">Hide this node</string>
<string name="text_hide_same_frame_nodes">Hide same frame nodes</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -991,5 +991,7 @@
<string name="text_write_secure_settings_description">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).</string>
<string name="text_write_system_settings">Escribir la configuración del sistema</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">La ruta resuelta para \"%1$s\" no puede ser nula</string>
<string name="text_hide_node">Ocultar este nodo</string>
<string name="text_hide_same_frame_nodes">Ocultar nodo del mismo marco</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -991,5 +991,7 @@
<string name="text_write_secure_settings_description">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é).</string>
<string name="text_write_system_settings">Écrire les paramètres système</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">Le chemin résolu pour \"%1$s\" ne peut pas être nul</string>
<string name="text_hide_node">Masquer ce nœud</string>
<string name="text_hide_same_frame_nodes">Masquer le nœud du même cadre</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -992,5 +992,7 @@
<string name="text_write_secure_settings_description">アプリケーションが読み取ることはできるが, 書き込むことはできないシステム環境設定を含む, 安全なシステム設定です.\nこれは, ユーザーがシステムアプリの UI を通じて明示的に変更する必要がある環境設定のためのものです.\nセキュアなシステム設定を許可すると, 通常のアプリケーションはセキュアな設定 (アクセシビリティサービスなど) を直接変更できるようになります</string>
<string name="text_write_system_settings">システム設定の書き込み</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">\"%1$s\" の解決済みパスは null にできません</string>
<string name="text_hide_node">このノードを隠す</string>
<string name="text_hide_same_frame_nodes">同じフレームのノードを隠す</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -993,5 +993,7 @@
<string name="text_write_secure_settings_description">애플리케이션이 읽을 수 있지만 쓸 수없는 시스템 환경 설정을 포함하는 보안 시스템 설정.\n이들은 사용자가 시스템 앱의 UI 를 통해 명시 적으로 수정 해야하는 선호도입니다.\n보안 시스템 설정 권한을 사용하면 일반 애플리케이션이 보안 설정 (예: 접근성 서비스)을 직접 수정할 수 있습니다.</string>
<string name="text_write_system_settings">시스템 설정을 작성하십시오</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">\"%1$s\" 에 대한 해결된 경로는 null 일 수 없습니다</string>
<string name="text_hide_node">이 노드를 숨기기</string>
<string name="text_hide_same_frame_nodes">동일 프레임의 노드를 숨기기</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -991,5 +991,7 @@
<string name="text_write_secure_settings_description">Настройки безопасности системы, содержащие системные предпочтения, которые приложения могут читать, но не имеют права записывать.\nОни предназначены для параметров, которые пользователь должен явно изменить через пользовательский интерфейс системного приложения.\nПри наличии разрешения на безопасные системные настройки обычные приложения могут напрямую изменять безопасные настройки (например, служба доступности).</string>
<string name="text_write_system_settings">Запись системных настроек</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">Разрешённый путь для \"%1$s\" не может быть равен null</string>
<string name="text_hide_node">Скрыть этот узел</string>
<string name="text_hide_same_frame_nodes">Скрыть узел того же фрейма</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -989,5 +989,7 @@
<string name="text_write_secure_settings_description">安全設置包含應用程序可讀但不可寫入的設置選項, 這些選項只能由 UI 或系統級別應用修改.\n被授予 \"修改安全設置權限\" 後, 普通應用可直接修改上述安全設置 (例如無障礙服務).</string>
<string name="text_write_system_settings">修改系統設置</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">解析後的路徑 \"%1$s\" 不可為 null</string>
<string name="text_hide_node">隱藏此節點</string>
<string name="text_hide_same_frame_nodes">隱藏同框節點</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -989,5 +989,7 @@
<string name="text_write_secure_settings_description">安全設定包含應用程式可讀但不可寫入的設定選項, 這些選項只能由 UI 或系統級別應用修改.\n被授予 \"修改安全設定許可權\" 後, 普通應用可直接修改上述安全設定 (例如無障礙服務).</string>
<string name="text_write_system_settings">修改系統設定</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">解析後的路徑 \"%1$s\" 不可為 null</string>
<string name="text_hide_node">隱藏此節點</string>
<string name="text_hide_same_frame_nodes">隱藏同框節點</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -989,5 +989,7 @@
<string name="text_write_secure_settings_description">安全设置包含应用程序可读但不可写入的设置选项, 这些选项只能由 UI 或系统级别应用修改.\n被授予 \"修改安全设置权限\" 后, 普通应用可直接修改上述安全设置 (例如无障碍服务).</string>
<string name="text_write_system_settings">修改系统设置</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">解析后的路径 \"%1$s\" 不可为 null</string>
<string name="text_hide_node">隐藏此节点</string>
<string name="text_hide_same_frame_nodes">隐藏同框节点</string>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1218,5 +1218,7 @@
<string name="text_write_secure_settings_description">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).</string>
<string name="text_write_system_settings">Write system settings</string>
<string name="error_resolved_path_for_a_relative_path_cannot_be_null">Resolved path for \"%1$s\" cannot be null</string>
<string name="text_hide_node">Hide this node</string>
<string name="text_hide_same_frame_nodes">Hide same frame nodes</string>

</resources>