自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
旋控器
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
旋控器是车载中控台中的一个旋钮及其四周的按钮,用于控制车机。旋控器必须支持以下功能:
- 向四个方向(上、下、左、右)微移
- 顺时针和逆时针旋转
- 居中的按钮
- “返回”按钮
旋控器可能支持沿对角线微移。必须可以无限旋转,并设有定位点(发出咔嗒声)。可以在中心使用一个按钮,也可以将旋钮本身用作按钮。旋钮四周通常还有其他按钮,例如“主屏幕”、“媒体”、“电话”和“导航”(地图)。
旋控器的工作方式如下:
- 微移用于在界面中粗略导航。屏幕分为几个矩形区域,称为
FocusAreas
。微移就是在这些 FocusAreas
之间导航。
- 旋转用于精细导航。旋转按照与 Tab 键相同的顺序,在
FocusArea
中的可聚焦视图之间导航。
- 居中的按钮用于对聚焦的视图执行操作,例如执行按下按钮的操作。
- 返回按钮的功能通常与 Android 中返回按钮的正常功能相同,但存在直接操作的例外情况,如下所述。
微移历史记录用于确保在向右微移后再向左微移时能够返回之前所在的位置。这可由 OEM 进行配置。
如果 OEM 进行了相应配置,尝试微移到屏幕边缘之外会触发系统级操作,例如触发返回操作。
如果最近一次互动是通过轻触而非旋控器进行的,任何微移、旋转或按下中心按钮的操作都会聚焦某个视图从而启动旋转模式,但操作本身通常会被忽略。后续操作会如上所述正常发挥作用,移动焦点或执行操作。
如果在 SeekBar
获得焦点的情况下按居中的按钮,就会启动直接操作 (DM) 模式。在此模式下,旋转用于操作 SeekBar
而非用于导航。返回按钮用于退出 DM 模式。支持 DM 模式的其他视图可以使用微移及旋转来操作视图。例如,地图视图可以使用旋转来缩放地图,使用微移来平移(滚动)地图。
如需了解详情,请参阅以下资源:
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Rotary controller\n\nA *rotary controller* is a knob and surrounding buttons in the center console of\nan automobile used to control the head unit. A rotary controller must support these functions:\n\n- Nudge in four directions (up, down, left, and right)\n- Rotate clockwise and counterclockwise\n- Center button\n- Back button\n\nA rotary controller might support diagonal nudges. Rotation must be limitless with\ndetents (clicks). There can either be a button in the center or the rotary knob itself\ncan act as a button. There are typically additional buttons surrounding the rotary knob,\nfor example, Home, Media, Phone, and navigation (map).\n\nA rotary controller works like this:\n\n- Nudging is used for *coarse* navigation in the user interface. The screen is partitioned into several rectangular regions, referred to as `FocusAreas`. Nudging navigates between these `FocusAreas`.\n- Rotation is used for *fine* navigation. Rotation navigates through the focusable views in a `FocusArea` in the same order as the Tab key.\n- Center button takes action on the focused view, for example to press a button.\n- Back button typically functions as usual in Android, an exception being [direct manipulation](#dm), described below.\n\nNudge history ensures that nudging right and then left takes you back where you were.\nThis can be configured by the OEM.\n\nWhen configured by the OEM, attempting to nudge off the edge of the screen triggers a\nsystem-wide action, for example Back.\n\nIf the most recent interaction took place through touch rather than the rotary controller,\nany nudge, rotate, or press of the Center button starts rotary mode by focusing a view, but\nis typically ignored. Subsequent actions function as described above, moving focus or\ntaking action.\n\nIf a `SeekBar` is focused when the Center button is pressed,\n*direct manipulation (DM)* mode starts. In this mode, rotation manipulates the\n`SeekBar` rather than navigating. The Back button is used to exit DM mode.\nOther views that support DM mode can use nudging as well as rotation to manipulate the view.\nFor example, a map view can use rotation to zoom and nudging to pan (scroll) the map.\n\nTo learn more, see:\n\n- [Develop apps](/docs/automotive/hmi/rotary_controller/app_developers)\n- [Develop apps\n without the Car UI library](/docs/automotive/hmi/rotary_controller/app_developers_no_carui)\n- [Integration guide for OEMs](/docs/automotive/hmi/rotary_controller/oem_integration)"]]