-
Notifications
You must be signed in to change notification settings - Fork 8
Remote UI Layout Analysis
The remote layout inspector converts uiautomator dump XML from the target device into semantic nodes and maps them onto the remote video overlay. It analyzes the accessibility tree, not screenshot pixels.
-
feature/remote/presentation/RemoteUiLayoutParser.kt: secure XML parsing, classification, labels, filtering, and deduplication. -
feature/remote/model/RemoteUiLayoutModels.kt: bounds, node, label-source, and snapshot models. -
feature/remote/ui/internal/RemoteLayoutInspectorUi.kt: coordinate mapping and overlay rendering. -
RemoteUiLayoutParserTest.kt: parser regression tests.
- Run
uiautomator dumpon the target device and retrieve its XML. - Parse XML with external entities and DTDs disabled.
- Traverse nodes and capture bounds, class, resource id, text, content description, and interaction/state attributes.
- Produce
INPUT,BUTTON,TEXT,TOGGLE,IMAGE,CONTAINER, orOTHERnodes. - Filter invisible, zero-area, system-decoration, and meaningless nodes, then deduplicate by semantic priority.
- Build a viewport from root bounds or node extents, map nodes onto the current remote image, and render them.
RemoteUiLayoutNode stores:
- Raw identity: package, class, resource id, text, and content description.
- Geometry:
RemoteUiLayoutBounds. - Interaction attributes: clickable, focusable, scrollable, and enabled.
- State attributes: focused, checkable, checked, selected, password, and visible-to-user.
- Derived information: kind, label, label source, component key, and descendant summaries.
Effective toggle state is resolved in this order: true checked or selected means checked; otherwise explicit negative phrases such as “unchecked” win before positive phrases such as “checked”.
-
EditText,TextInput, andAutoCompleteare primarilyINPUT. -
CompoundButton,CheckBox,Switch,Toggle, andRadioButtonareTOGGLE. -
ButtonandChipareBUTTON; Image and Text classes map toIMAGEandTEXT. - Small interactive Views, Images, or containers may be promoted to custom toggles using checkable state, resource ids, content descriptions, and agreement-text context.
- Labeled clickable containers with button-like geometry may be promoted to custom buttons.
- Labels prefer meaningful text or content descriptions and may humanize a resource id as fallback. Password input content is not exposed.
These heuristics serve general semantic recognition. Before adding an app-specific case, find a generalizable signal and add a test instead of accumulating package names and one-off resource ids in the main path.
- Do not render
visible-to-user=false, zero-area, system-bar/keyboard decoration, or pure-noise nodes. - For overlapping or same-component candidates, keep the node with greater semantic value; inputs, toggles, and buttons outrank ordinary containers.
- A snapshot prefers root XML bounds as its viewport and infers extents from nodes only when root bounds are unavailable.
- The overlay uses colors by kind and renders labels, borders, and applicable state indicators.
- It is a semantic visualization, not a pixel-accurate reproduction of the target app.
- A custom control that exposes no state may be classified correctly without a reliable checked value.
- Canvas, games, or pages without accessibility semantics expose only limited nodes.
- Resource-id and description heuristics can produce false positives or negatives; tune them using real XML samples and unit tests.
- Viewport, rotation, cropping, or aspect-ratio changes affect coordinate mapping, so parser and renderer must be checked together.
- Reduce a sanitized XML sample to the smallest reproducible fixture.
- Add or update
RemoteUiLayoutParserTestfor classification, labels, state, filtering, and deduplication. - Confirm existing fixtures do not regress after parser changes.
- For coordinate or rendering changes, manually verify at least one portrait and one landscape device.
- Never store accounts, passwords, or complete private page content in logs, fixtures, or the wiki.
Related: Remote Interaction Performance and Floating Menu and Engineering and Verification Rules.
- Overview / 总览
- Quick Start / 快速开始
- Connection & Pairing / 连接设备与配对
- Session Management / 会话管理
- Remote Control / 远程控制
- Settings / 设置
- Management Features / 管理功能
- FAQ / 常见问题
- Overview / 总览
- Technical Index / 技术文档索引
- Audit Checklist / 初始化与更新清单
- Conventions / 文档维护约定
- Architecture / 架构
- Module Map / 模块地图与边界
- Runtime Path / 运行时主链路
- Session State / 会话状态与事件
- Session Lifecycle / 会话配置与连接生命周期
- ADB, USB & Wireless / ADB、USB 与无线
- ADB Lifecycle / ADB 连接生命周期
- Pairing / 设备配对与无线调试
- Codecs / 编码与解码
- Remote Interaction / 远程交互性能与悬浮菜单
- Clipboard / 剪贴板同步
- Management / 管理功能
- Events & Shell / 事件、监控与 Shell
- Logging / 日志系统与维护
- Troubleshooting / 分层排障方法
- UI Design / UI 设计系统
- Bilingual Copy / 双语与文案
- Remote UI Analysis / 远程 UI 布局分析
- Engineering Rules / 工程与验证规则
- External Research / 外部研究与取舍
Technical topics appear here only after their page-level audit is complete. / 技术主题仅在完成逐页审核后加入侧边栏。