CarListDialog.DialogSubSection

public static class CarListDialog.DialogSubSection
extends Object

java.lang.Object
   ↳ androidx.car.app.CarListDialog.DialogSubSection


A struct that holds data for a section. A section is a combination of the section title and the list of items associated with that section.

Summary

Public constructors

CarListDialog.DialogSubSection(String title, String[] items)

Creates a subsection.

Public methods

int getItemCount()

Returns the total number of items related to this section.

String[] getItems()

Returns the section items.

String getTitle()

Returns the section title.

Inherited methods

Public constructors

CarListDialog.DialogSubSection

public CarListDialog.DialogSubSection (String title, 
                String[] items)

Creates a subsection.

Parameters
title String: The title of the section. Must be non-empty.

items String: A list of items associated with this section. This list cannot be null or empty.

Public methods

getItemCount

public int getItemCount ()

Returns the total number of items related to this section. The length of the section is defined as the number of items plus an entry for the title of the section.

This value will always be greater than 0 due to the fact that the title must always be specified and the number of items passed to this DialogSubSection should always be greater than 0.

Returns
int

getItems

public String[] getItems ()

Returns the section items.

Returns
String[]

getTitle

public String getTitle ()

Returns the section title.

Returns
String