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
, andDirectManipulationHelper
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.