The Android Developer Challenge is back! Submit your idea before December 2.

DialogSubSection

open class DialogSubSection
kotlin.Any
   ↳ 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

<init>(@NonNull title: CharSequence, @NonNull items: Array<CharSequence!>)

Creates a subsection.

Public methods

open Int

Returns the total number of items related to this section.

open Array<CharSequence!>

Returns the section items.

open CharSequence

Returns the section title.

Public constructors

<init>

DialogSubSection(@NonNull title: CharSequence, @NonNull items: Array<CharSequence!>)

Creates a subsection.

Parameters
title CharSequence: The title of the section. Must be non-empty.
items CharSequence: A list of items associated with this section. This list cannot be null or empty.

Public methods

getItemCount

open fun getItemCount(): Int

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.

getItems

@NonNull open fun getItems(): Array<CharSequence!>

Returns the section items.

getTitle

@NonNull open fun getTitle(): CharSequence

Returns the section title.