自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
车载设备界面库版本说明
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页介绍了对下列各个版本中的车载设备界面库进行的更新。
car-ui-lib 2.6.0
新功能
- 针对
CarUiToolbar
徽标添加了一个点按监听器。
已解决的问题
- 修复了通过插件进行更新时
CarUiToolbar
的溢出对话框内容会保持不更新的问题。
- 修复了因应用了错误的边衬区而导致
CarUiRecyclerView
的滚动条不可见的问题。
- 修复了插件返回 null
InsetsChangedListener
的问题。
- 添加了检查,以强制
AppStyledView
中呈现的内容不使用任何 Theme.CarUi
。
- 修复了较大横向屏幕中的默认
AppStyledView
定位问题。
- 添加了自定义
AppStyledView
背景和暗度的功能。
- 添加了对在
AppStyledView
显示后调用 AppStyledDialog#setContentView()
的支持。
废弃了以下方法:
- 废弃了
CarUi#installBaseLayoutAround(View, InsetsChangedListener, boolean)
,改用 CarUi#InsetsChangedListener(Context, View, InsetsChangedListener, boolean)
。
- 废弃了
CarUi#installBaseLayoutAround(View, InsetsChangedListener, boolean,
boolean)
,改用 CarUi#InsetsChangedListener(Context, View,
InsetsChangedListener, boolean, boolean)
。
car-ui-lib-plugin-apis 1.5.0
新功能
- 添加了对
CarUiToolbar
徽标点按监听器的自定义功能。
废弃了以下几项:
- 废弃了
PluginFactoryOEMV6
,改用 PluginFactoryOEMV7
。
- 废弃了
ToolbarControllerOEMV2
,改用 ToolbarControllerOEMV3
。
car-ui-lib 2.5.1
已解决的问题
- 修复了一个导致无法加载 car-ui-lib 插件的 ProGuard 问题。
- 修复了在运行时会导致 NPE 的插件向前兼容性问题。
- 强制 car-ui-lib 插件必须是系统应用。
- 修复了在某些情况下
CarUiRecyclerView
不显示滚动条的问题。
- 修复了使用插件时所选标签页无法更新的问题。
- 修复了在使用插件时,实例化
SearchView
会出现的问题。
- 使用 activity 上下文初始化汽车服务用户体验限制状态回调,以确保正确的显示配置。
- 更新了 null 性注解。
car-ui-lib 2.5.0
已解决的问题
- 优化了插件启动时间。
- 修复了应用始终将最大受支持插件版本返回为 1 的问题。
- 不再将主题强制从
AppStyledView
替换为 Theme.CarUi
。
- 添加了一个可替换的方法,以便在
ListPreferenceFragment
上设置标题。
car-ui-lib-plugin-apis 1.4.0
新功能
- 允许 OEM 自定义
CarUiPreference
。
废弃了以下几项:
- 废弃了
PluginFactoryOEMV5
,改用 PluginFactoryOEMV6
。
car-ui-lib 2.4.0
新功能
- 添加了对向
AppStyledView
过渡的支持。
已解决的问题
- 将
AppStyledRecyclerViewAdapter
更新为不再公开。
- 通过优化
AppStyledDialogController
提供了便捷的上下文方法。
- 将
AppStyledViewNavIcon
定义移到了 AppStyledDialogController
。
- 在
AppStyledView
中不再将主题强制替换为 Theme.CarUi
。
- 添加了过渡以支持
AppStyledView
界面的呈现。
- 向可叠加的项列表中添加了
car_ui_recycler_view_no_scrollbar
。
- 为
CarUiRecyclerView
espresso ViewActions
和 ViewMatchers
创建了 Gradle 库。
- 重构了应用样式的视图,以使用
ScrollView
。
car-ui-lib-plugin-apis 1.3.0
新功能
废弃了以下几项:
- 废弃了
PluginFactoryOEMV4
,改用 PluginFactoryOEMV5
。
- 废弃了
RecyclerViewOEMV1
,改用 RecyclerViewOEMV2
。
- 废弃了
OnScrollListenerOEMV1
,改用 RecyclerViewOEMV2.OnScrollListenerOEMV2
。
car-ui-lib 2.3.0
新功能
添加了以下新组件:
添加了对以下滚动条属性的支持:
android:fadeScrollbars
android:scrollbars
android:scrollbarThumbVertical
android:scrollbarTrackVertical
android:scrollbarStyle
android:scrollbarFadeDuration
android:verticalScrollbarPosition
android:requiresFadingEdge
已解决的问题
修复了 CarUiRecyclerView
(它在重新创建 Activity
后不会保持位置)。
解决了客户端代码与 IME 服务之间的位图序列化不兼容问题。
允许在 PreferenceFragment
中使用 NavHostFragment
。
car-ui-lib-plugin-apis 1.2.0
新功能
已将 java.util.function
接口替换为以下库接口:
com.android.car.ui.plugin.oemapis.BiConsumer
com.android.car.ui.plugin.oemapis.Consumer
com.android.car.ui.plugin.oemapis.Function
废弃了以下几项:
- 废弃了
PluginFactoryOEMV3
,改用 PluginFactoryOEMV4
。
- 废弃了
ToolbarControllerOEMV1
,改用 ToolbarControllerOEMV2
。
- 废弃了
ContentListItemOEMV1
,改用 ContentListItemOEMV2
。
- 废弃了
ImeSearchInterfaceOEMV1
,改用 ImeSearchInterfaceOEMV2
。
已将 null 性接口的库实现替换为 androidx.annotations
的实现。
car-ui-lib-plugin-apis 1.1.1
此版本将 minSdkVersion
更新成了 28。
car-ui-lib 2.2.1
此版本:
- 引入了
CarUiFooterPreference
- 将
minSdkVersion
更新成了 28。
car-ui-lib-plugin-apis 1.1.0
此版本:
- 废弃了
AppStyledViewControllerOEMV1
引入了 AppStyledViewControllerOEMV2
纳入了 AppStyledViewControllerOEMV1
中的更改:
public abstract int getContentAreaHeight();
public abstract int getContentAreaWidth();
废弃了 PluginFactoryOEMV1
和 PluginFactoryOEMV2
引入了 PluginFactoryOEMV3
接口。
car-ui-lib 2.1.0
此版本:
添加了 AppStyledView
客户端 API:
public int getContentAreaHeight();
public int getContentAreaWidth();
引入了 CarUiPrimarySwitchPreference
将 AppStyledDialogController
构造函数更新为要求使用 Activity
,而不是 Context
:
添加了:
public AppStyledDialogController(android.app.Activity);
废弃了:
public AppStyledDialogController(android.content.Context);
car-ui-lib-plugin-apis 1.0.1
此版本添加了 null 性注解。
car-ui-lib-plugin-apis 1.0.0
此版本引入了对以下 car-ui-lib
插件 API 的支持:
AppStyledViewDialog
CarUiRecyclerView
CarUiToolbar
CarUiListItems
car-ui-lib 2.0.0
此版本可通过 Google Maven 获取,推出了针对以下组件的 car-ui-lib
插件支持:
AppStyledViewDialog
CarUiRecyclerView
CarUiToolbar
CarUiListItems
car-ui-lib 1.0.0
此版本可通过 Android 12 及更低版本的 AOSP 获取,针对以下各项提供了支持:
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[[["易于理解","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-03-26。"],[],[],null,["# Car UI library release notes\n\nThis page describes updates made to the Car UI library in each of the releases\nlisted below.\n\ncar-ui-lib 2.6.0\n----------------\n\n### New features\n\n- Added a tap listener for the `CarUiToolbar` logo.\n\n### Issues addressed\n\n- Fixed an issue where `CarUiToolbar`'s overflow dialog content would remain stale when making the updates through the plugin.\n- Fixed an issue where `CarUiRecyclerView`'s scrollbar was not visible because incorrect insets were applied.\n- Fixed an issue when the plugin returned a null `InsetsChangedListener`.\n- Added a check to enforce content rendered in `AppStyledView` must not use `Theme.CarUi`.\n- Fixed default `AppStyledView` positioning in large landscape screens.\n- Added customization of `AppStyledView` background and dim amount.\n- Added support for calls to `AppStyledDialog#setContentView()` after `AppStyledView` is shown.\n\nDeprecated these methods:\n\n- `CarUi#installBaseLayoutAround(View, InsetsChangedListener, boolean)`, use `CarUi#InsetsChangedListener(Context, View, InsetsChangedListener, boolean)` instead.\n- `CarUi#installBaseLayoutAround(View, InsetsChangedListener, boolean,\n boolean)`, use `CarUi#InsetsChangedListener(Context, View,\n InsetsChangedListener, boolean, boolean)` instead.\n\ncar-ui-lib-plugin-apis 1.5.0\n----------------------------\n\n### New features\n\n- Added customization of `CarUiToolbar` logo tap listener.\n\nDeprecated these items:\n\n- `PluginFactoryOEMV6`, use `PluginFactoryOEMV7` instead.\n- `ToolbarControllerOEMV2`, use `ToolbarControllerOEMV3` instead.\n\ncar-ui-lib 2.5.1\n----------------\n\n### Issues addressed\n\n- Fixed a ProGuard issue that was preventing loading the car-ui-lib plugin.\n- Fixed forward compatibility for plugins that would cause NPE at runtime.\n- Enforce that car-ui-lib plugin has to be a system app.\n- Fixed `CarUiRecyclerView` not showing scrollbar in some scenarios.\n- Fixed selected tabs not updating when the plugin is used.\n- Fixed issues with instantiating `SearchView` when the plugin is used.\n- Initialize Car service UX restriction state callback using Activity context for correct display configuration.\n- Updated nullness annotations.\n\ncar-ui-lib 2.5.0\n----------------\n\n### Issues addressed\n\n- Optimized plugin startup time.\n- Fixed an issue where apps were always returning 1 as max supported plugin version.\n- Removed the overwriting of theme to force `Theme.CarUi` from `AppStyledView`.\n- Added overridable method to set title on `ListPreferenceFragment`.\n\ncar-ui-lib-plugin-apis 1.4.0\n----------------------------\n\n### New features\n\n- Allow OEM customization of `CarUiPreference`.\n\nDeprecated these items:\n\n- `PluginFactoryOEMV5`, use `PluginFactoryOEMV6` instead.\n\ncar-ui-lib 2.4.0\n----------------\n\n### New features\n\n- Added support for the transition to `AppStyledView`.\n\n### Issues addressed\n\n- Updated `AppStyledRecyclerViewAdapter` to no longer be public.\n- Provided a convenience method for context with optimization for `AppStyledDialogController`.\n- Moved the `AppStyledViewNavIcon` definition to `AppStyledDialogController`.\n- Removed forced overwriting of theme to `Theme.CarUi` in `AppStyledView`.\n- Added transitions to support the rendering of `AppStyledView` screens.\n- Added `car_ui_recycler_view_no_scrollbar` to the list of items that can be overlaid.\n- Created a Gradle library for `CarUiRecyclerView` espresso `ViewActions` and `ViewMatchers`.\n- Refactored the app-styled view to use `ScrollView`.\n\ncar-ui-lib-plugin-apis 1.3.0\n----------------------------\n\n### New features\n\nDeprecated these items:\n\n- `PluginFactoryOEMV4`, use `PluginFactoryOEMV5` instead.\n- `RecyclerViewOEMV1`, use `RecyclerViewOEMV2` instead.\n- `OnScrollListenerOEMV1`, use `RecyclerViewOEMV2.OnScrollListenerOEMV2` instead.\n\ncar-ui-lib 2.3.0\n----------------\n\n### New features\n\nAdded new component:\n\n- `CarUiShortcutsPopup`\n\nAdded support for the following scrollbar attributes:\n\n- `android:fadeScrollbars`\n- `android:scrollbars`\n- `android:scrollbarThumbVertical`\n- `android:scrollbarTrackVertical`\n- `android:scrollbarStyle`\n- `android:scrollbarFadeDuration`\n- `android:verticalScrollbarPosition`\n- `android:requiresFadingEdge`\n\n### Addressed issues\n\n- Fixed `CarUiRecyclerView`, which did not maintain position upon `Activity`\n recreation.\n\n- Resolved bitmap serialization incompatibility between the client code and\n the IME service.\n\n- Enabled usage of `NavHostFragment` with `PreferenceFragment`.\n\ncar-ui-lib-plugin-apis 1.2.0\n----------------------------\n\n### New features\n\nReplaced usage of `java.util.function` interfaces with the following library\ninterfaces:\n\n- `com.android.car.ui.plugin.oemapis.BiConsumer`\n- `com.android.car.ui.plugin.oemapis.Consumer`\n- `com.android.car.ui.plugin.oemapis.Function`\n\nDeprecated these items:\n\n- `PluginFactoryOEMV3`, use `PluginFactoryOEMV4` instead.\n- `ToolbarControllerOEMV1`, use `ToolbarControllerOEMV2` instead.\n- `ContentListItemOEMV1`, use `ContentListItemOEMV2` instead.\n- `ImeSearchInterfaceOEMV1`, use `ImeSearchInterfaceOEMV2` instead.\n\nReplaced the library implementation of nullness interfaces with implementations\nof `androidx.annotations`.\n\ncar-ui-lib-plugin-apis 1.1.1\n----------------------------\n\nThis release updates the `minSdkVersion` to 28.\n\ncar-ui-lib 2.2.1\n----------------\n\nThis release:\n\n- Introduces `CarUiFooterPreference`\n- Updates the `minSdkVersion` to 28.\n\ncar-ui-lib-plugin-apis 1.1.0\n----------------------------\n\nThis release:\n\n- Deprecates `AppStyledViewControllerOEMV1`\n- Introduces `AppStyledViewControllerOEMV2`\n\n- Incorporates changes from `AppStyledViewControllerOEMV1`:\n\n public abstract int getContentAreaHeight();\n public abstract int getContentAreaWidth();\n\n- Deprecates `PluginFactoryOEMV1` and `PluginFactoryOEMV2`\n\n- Introduces the `PluginFactoryOEMV3` interface.\n\ncar-ui-lib 2.1.0\n----------------\n\nThis release:\n\n- Adds `AppStyledView` client APIs:\n\n public int getContentAreaHeight();\n public int getContentAreaWidth();\n\n- Introduces `CarUiPrimarySwitchPreference`\n\n- Updates the `AppStyledDialogController` constructor to require `Activity`\n instead of `Context`:\n\n - Adds:\n\n public AppStyledDialogController(android.app.Activity);\n\n - Deprecates:\n\n public AppStyledDialogController(android.content.Context);\n\ncar-ui-lib-plugin-apis 1.0.1\n----------------------------\n\nThis release adds nullness annotations.\n\ncar-ui-lib-plugin-apis 1.0.0\n----------------------------\n\nThis release introduces support for the following `car-ui-lib` plugin APIs:\n\n- `AppStyledViewDialog`\n- `CarUiRecyclerView`\n- `CarUiToolbar`\n- `CarUiListItems`\n\ncar-ui-lib 2.0.0\n----------------\n\nThis version, available on [Google\nMaven](https://maven.google.com/web/index.html?#com.android.car.ui),\nintroduces `car-ui-lib` plugin support for these components:\n\n- `AppStyledViewDialog`\n- `CarUiRecyclerView`\n- `CarUiToolbar`\n- `CarUiListItems`\n\ncar-ui-lib 1.0.0\n----------------\n\nThis release is available on AOSP for Android 12 and lower and provides\nsupport for:\n\n- `AppStyledViewDialog`\n- [`CarUiRecyclerView`](/docs/devices/automotive/hmi/car_ui/caruirecyclerview)\n- [`CarUiToolbar`](/docs/devices/automotive/hmi/car_ui/toolbar_rro)\n- [`CarUiListItems`](/docs/devices/automotive/hmi/car_ui/caruilistitem)\n- Dialog\n- Resource customization through [runtime resource overlays (RROs)](/docs/core/architecture/rros)\n- [`PreferencesFragment`](/docs/devices/automotive/hmi/car_ui/caruipreference)\n- [Rotary support](/docs/devices/automotive/hmi/rotary_controller/oem_integration)\n- `WideScreenImeKeyboard`"]]