Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

CarUxRestrictions.Builder

public static final class CarUxRestrictions.Builder
extends Object

java.lang.Object
   ↳ androidx.car.uxrestrictions.CarUxRestrictions.Builder


Builder class for CarUxRestrictions

Summary

Public constructors

CarUxRestrictions.Builder(boolean requiresDistractionOptimization, int activeRestrictions, long timestamp)

Public methods

CarUxRestrictions build()

Build and return the CarUxRestrictions object

CarUxRestrictions.Builder setMaxContentDepth(int maxContentDepth)

Set the maximum number of levels that the user can navigate to when CarUxRestrictions.UX_RESTRICTIONS_LIMIT_CONTENT is imposed.

CarUxRestrictions.Builder setMaxCumulativeContentItems(int maxCumulativeContentItems)

Set the maximum number of cumulative content items that can be displayed when CarUxRestrictions.UX_RESTRICTIONS_LIMIT_CONTENT is imposed.

CarUxRestrictions.Builder setMaxStringLength(int maxStringLength)

Set the maximum length of general purpose strings that can be displayed when CarUxRestrictions.UX_RESTRICTIONS_LIMIT_STRING_LENGTH is imposed.

Inherited methods

Public constructors

CarUxRestrictions.Builder

public CarUxRestrictions.Builder (boolean requiresDistractionOptimization, 
                int activeRestrictions, 
                long timestamp)

Parameters
requiresDistractionOptimization boolean

activeRestrictions int

timestamp long

Public methods

build

public CarUxRestrictions build ()

Build and return the CarUxRestrictions object

Returns
CarUxRestrictions

setMaxContentDepth

public CarUxRestrictions.Builder setMaxContentDepth (int maxContentDepth)

Set the maximum number of levels that the user can navigate to when CarUxRestrictions.UX_RESTRICTIONS_LIMIT_CONTENT is imposed.

Parameters
maxContentDepth int

Returns
CarUxRestrictions.Builder

setMaxCumulativeContentItems

public CarUxRestrictions.Builder setMaxCumulativeContentItems (int maxCumulativeContentItems)

Set the maximum number of cumulative content items that can be displayed when CarUxRestrictions.UX_RESTRICTIONS_LIMIT_CONTENT is imposed.

Parameters
maxCumulativeContentItems int

Returns
CarUxRestrictions.Builder

setMaxStringLength

public CarUxRestrictions.Builder setMaxStringLength (int maxStringLength)

Set the maximum length of general purpose strings that can be displayed when CarUxRestrictions.UX_RESTRICTIONS_LIMIT_STRING_LENGTH is imposed.

Parameters
maxStringLength int

Returns
CarUxRestrictions.Builder