自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
將 Car UI 程式庫整合至應用程式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Car UI 程式庫包含兩個元素供應用程式實作:
應用程式可將 Car UI 程式庫新增為依附元件,以便整合該程式庫:
設定 Car UI 元件的樣式
一般來說,應用程式應提供資料 (在某些情況下為圖片和圖示),以便執行所有必要功能。舉例來說,車輛 UI 程式庫會提供「返回」、「關閉」、「搜尋」和「選單」等標準圖示。如果您發現缺少資源,或是無法透過提供的元件達成某些功能,請與 Android Automotive 合作夥伴工程團隊聯絡。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# Integrate the Car UI library into apps\n\nCar UI library contains two elements for apps to implement:\n\n- **Components.**Java classes that implement a specific behavior. For example,\n CarUiRecyclerView and Toolbar.\n\n- **Resources.** Individual Android resources that represent the *knobs*\n available for OEMs to achieve consistency with their own design. The components above use these\n resources to become *customizable*.\n\nApps integrate Car UI library by adding it as a dependency:\n\n- Android 9 and Android 10 (`Android.mk` file), add the following:\n\n ```maple\n LOCAL_STATIC_ANDROID_LIBRARIES := car-ui-lib\n ```\n- Android 11 (and higher) (`Android.bp`), add the following:\n\n ```scdoc\n static_libs: [\n ...\n \"car-ui-lib-bp\",\n ]\n ```\n\nStyle Car UI components\n-----------------------\n\nIn general, apps should be able to achieve all necessary functionality by providing\ndata and, in certain cases, images and icons. For example, standard icons such as Back, Close,\nSearch, and Menu are provided by the Car UI library. Engage with Android Automotive Partner\nEngineering if you find there are missing resources or if there is functionality that can't be\nachieved with the provided components."]]