Develop apps without the Car UI library
Stay organized with collections
Save and categorize content based on your preferences.
The
Car UI Library (car-ui-library)
is a self-consistent automotive UI library that can be customized by OEMs. Google strongly
recommends you use the car-ui-library to create your app. If this isn't feasible, there are
two alternatives:
- From Android 12, you can use
car-rotary-lib
,
a subset of car-ui-library.
- On Android 11, you MUST implement your own
FocusParkingView
, FocusArea
, and
DirectManipulationHelper
as described below.
Implement FocusParkingView
You either can implement your own FocusParkingView
or copy the class from the
car-ui-library to your project.
To implement FocusParkingView
:
- Hard code the accessibility class name so that the
RotaryService
can recognize it:
@Override
public CharSequence getAccessibilityClassName() {
return "com.android.car.ui.FocusParkingView";
}
Implement FocusArea
Like FocusParkingView
, you can either implement your own FocusArea
or copy the class from the car-ui-library to your project.
To implement FocusArea
:
- Hard code the accessibility class name so that rotary service can recognize it:
@Override
public CharSequence getAccessibilityClassName() {
return "com.android.car.ui.FocusArea";
}
Implement DirectManipulationHelper
This is a utility class. You can copy the class from the car-ui-library to your project.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-08-28 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-08-28 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-28 UTC."]]