自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
附錄 B:自訂
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
為確保車輛 UI 自訂項目能正常運作,您必須遵守下列事項。
一般
無論版面配置為何,此節中的限制都會生效:
元素 |
說明 |
---|
字體排版 |
|
對比 |
- 前景 (文字) 和背景之間的對比度必須至少為 4.5:1。
- 按鈕顏色和背景色彩之間的對比度至少須為 3:1。
- 分頁選取狀態與背景的對比度必須至少為 4.5:1。
- 選取的分頁狀態與未選取狀態的對比度,至少須為 3:1。
|
其他 |
- 所有圖示都必須是向量可繪項目。
- 觸控目標的寬度必須至少為 76 dp。
- 填充常數必須依序遞減顯示,例如:
car_ui_padding_0 > car_ui_padding_1 >
car_ui_padding_2
|
元件
下方提供的值適用於特定元件:
元素 |
說明 |
---|
|
應足夠寬,可顯示至少 20 個半形字元的標題字串。 |
偏好設定 |
應足夠寬,可顯示至少 20 個半形字元的標題字串。 |
應用程式樣式檢視畫面
| 應為:
- 寬度至少要足以顯示 672 個密度獨立像素 (dp)。
- 高度足以顯示至少 672 dp。
|
版面配置
本節的限制適用於特定版面配置和 Car UI 程式庫元件的組合。我們觀察到一系列特殊案例,並將這些案例歸納為新興模式。
位置對話方塊
測試對話方塊包含與 Google Play 服務位置對話方塊相同的內容,並使用 Car UI 程式庫元件建構,經過測試以確保完整顯示內容:
元素 |
說明 |
---|
標題 |
必須足夠寬,才能顯示至少 38 個「W」字元的字串。 |
內文 |
必須完全可見,且大小足以顯示下列項目:
- 字串可能包含至少 270 個「W」字元。
- 至少四行文字。
|
行動號召 (CTA) |
行動號召按鈕必須完全可見:
- 對話方塊的寬度必須足以顯示至少兩個 CTA。
- 標題的寬度必須足以顯示至少 9 個「W」字元長度的字串。
|
「設定」畫面
「測試設定」畫面由應用程式列、子標題和清單元素元件組成,請參閱下表:
元素 |
說明 |
---|
應用程式列 |
- 標題長度必須足以顯示至少 12 個半形「W」字元的字串。
- 高度不得少於 76 dp。
|
子標題 |
必須足夠寬,才能顯示至少 12 個「W」字元的字串。 |
清單元素 |
必須符合下列條件:
- 寬度足以顯示至少 12 個「W」字元的字串。
- 高度至少為 76 dp。
|
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# Appendix B, customization\n\nTo ensure Car UI customizations perform as intended, you MUST adhere to the\nitems described below.\n\nGeneral\n-------\n\nLimits in this section are true regardless of layout:\n\n| Element | Description |\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ### Typography | - Tab text labels MUST be wide enough to display strings of at least 6 \"W\" characters. - Text containers MUST be tall enough to fully display a single \"H\" character. - Text sizes MUST appear in descending order, for example: `car_ui_body_1` \\\u003e `car_ui_body_2` \\\u003e `car_ui_body_3` |\n| ### Contrast | - Contrast between foreground (text) and background MUST be at least 4.5:1. - Contrast between button color and background MUST be at least 3:1. - Tab selected state contrast with background MUST be at least 4.5:1. - Tab selected state contrast with unselected state MUST be at least 3:1. |\n| ### Others | - All icons MUST be vector drawables. - Touch targets MUST be at least 76 dp wide. - Padding constants MUST appear in descending order, for example: `car_ui_padding_0` \\\u003e `car_ui_padding_1` \\\u003e `car_ui_padding_2` |\n\nComponents\n----------\n\nValues provided below apply to specific components:\n\n| Element | Description |\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| ### Toolbar | SHOULD be wide enough to display title strings of at least 20 \"W\" characters. |\n| ### Preference | SHOULD be wide enough to display title strings of at least 20 \"W\" characters. |\n| ### App styled view | SHOULD be: - Wide enough to display at least 672 density-independent pixels (dp). - Tall enough to display at least 672 dp. |\n\nLayout\n------\n\nLimits in this section pertain to specific layouts and combinations of Car UI library components.\nA series of unique cases have been observed and generalized into emergent patterns.\n\n### Location dialog\n\nA test dialog that contains the same content as the Google Play Services location dialog,\nconstructed with Car UI library components and tested to ensure full content visibility:\n\n| Element | Description |\n|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Title** | MUST wide enough to display strings of at least 38 \"W\" characters. |\n| **Body** | MUST be completely visible and large enough to display: - Strings that may consist of at least 270 \"W\" characters. - At least four lines of text. |\n| **Call-to-action (CTA)** | CTA MUST be completely visible: - Dialog MUST be wide enough to display at least two CTAs. - Titles MUST be wide enough to display strings of at least 9 \"W\" characters. |\n\n### Settings screen\n\nThe Test Settings screen is composed of the app bar, subheader, and list elements components,\nwhich are described in the table:\n\n| Element | Description |\n|-------------------|-------------------------------------------------------------------------------------------------------------|\n| **App bar** | - Title MUST be wide enough to display strings of at least 12 \"W\" characters. - MUST be at least 76dp tall. |\n| **Subheader** | MUST be wide enough to display strings of at least 12 \"W\" characters. |\n| **List elements** | MUST be: - Wide enough to display strings of at least 12 \"W\" characters. - At least 76dp tall. |"]]