自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
旋轉控制器
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
旋轉控制器是汽車中控台上的旋鈕和周圍按鈕,用於控制車用運算主機。旋轉控制器必須支援下列功能:
- 往四個方向 (上、下、左和右) 微調
- 順時針和逆時針旋轉
- 中間按鈕
- 「返回」按鈕
旋轉控制器可能支援對角移動。旋轉動作必須無限,且有停頓點 (點擊)。你可以在旋鈕中央放置按鈕,或是讓旋鈕本身充當按鈕。旋鈕周圍通常會圍繞著其他按鈕,例如「Home」、「Media」、「Phone」和「Navigation (地圖)」。
旋轉控制器的運作方式如下:
- 輕推用於使用者介面中的粗略導覽。螢幕會分割為多個矩形區域,稱為
FocusAreas
。輕推即可在這些 FocusAreas
之間瀏覽。
- 旋轉功能可用於精細導覽。旋轉會以與 Tab 鍵相同的順序,在
FocusArea
中瀏覽可聚焦的檢視畫面。
- 中間按鈕會對焦點所在的檢視畫面採取動作,例如按下按鈕。
- 返回按鈕通常會在 Android 中正常運作,但例外狀況是直接操控,請參閱下文。
輕推記錄可確保向右輕推再向左輕推,即可返回原始位置。原始設備製造商 (OEM) 可以設定這項資訊。
當原始設備製造商 (OEM) 進行設定時,嘗試將螢幕推離邊緣會觸發系統層級的動作,例如返回。
如果最近的互動是透過觸控而非旋轉控制器進行,則任何輕推、旋轉或按下中間按鈕的動作都會透過將焦點設為檢視畫面來啟動旋轉模式,但通常會遭到忽略。後續動作會如上所述運作,移動焦點或採取行動。
如果在按下「Center」按鈕時,SeekBar
處於聚焦狀態,系統就會啟動直接操作 (DM) 模式。在這個模式中,旋轉會操控 SeekBar
,而非導覽。返回按鈕可用來退出 DM 模式。支援 DM 模式的其他檢視畫面可使用微調和旋轉功能來操控檢視畫面。舉例來說,地圖檢視畫面可以使用旋轉功能縮放地圖,並透過平移功能捲動地圖。
如需更多資訊,請參閱:
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間: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)"]]