androidx.slice.builders
Classes
CellBuilderDsl |
Helper class annotated with @SliceMarker, which is annotated with @DslMarker. |
GridRowBuilder |
Builder to construct a grid row which may be added as a row to |
GridRowBuilder.CellBuilder |
Builder to construct a cell. |
GridRowBuilderDsl |
Helper class annotated with @SliceMarker, which is annotated with @DslMarker. |
HeaderBuilderDsl |
Helper class annotated with @SliceMarker, which is annotated with @DslMarker. |
InputRangeBuilderDsl |
Helper class annotated with @SliceMarker, which is annotated with @DslMarker. |
ListBuilder |
Builder for constructing slices composed of rows of content. |
ListBuilder.HeaderBuilder |
Builder to construct a header row. |
ListBuilder.InputRangeBuilder |
Builder to construct a input range row. |
ListBuilder.RangeBuilder |
Builder to construct a range row which can be added to a |
ListBuilder.RatingBuilder |
Builder to construct a input star rating. |
ListBuilder.RowBuilder |
Builder to construct a row. |
ListBuilderDsl |
Helper class annotated with @SliceMarker, which is annotated with @DslMarker. |
RangeBuilderDsl |
Helper class annotated with @SliceMarker, which is annotated with @DslMarker. |
RowBuilderDsl |
Helper class annotated with @SliceMarker, which is annotated with @DslMarker. |
SelectionBuilder |
Builder to construct a selection which can be added to a |
SliceAction |
Class representing an action, supports tappable icons, custom toggle icons, and default toggles, as well as date and time pickers. |
TemplateSliceBuilder |
Base class of builders of various template types. |
Top-level functions summary
inline Slice |
Reduces verbosity required to build a Slice in Kotlin. |
SliceAction |
tapSliceAction(Factory method to build a tappable |
SliceAction |
toggleSliceAction(Factory method to build a toggleable |
Extension functions summary
inline GridRowBuilder |
GridRowBuilderDsl.cell(buildCell: CellBuilderDsl.() -> Unit) |
inline ListBuilder |
ListBuilderDsl.gridRow(buildGrid: GridRowBuilderDsl.() -> Unit) |
inline ListBuilder |
ListBuilderDsl.header(buildHeader: HeaderBuilderDsl.() -> Unit) |
inline ListBuilder |
ListBuilderDsl.inputRange(buildInputRange: InputRangeBuilderDsl.() -> Unit) |
inline ListBuilder |
ListBuilderDsl.range(buildRange: RangeBuilderDsl.() -> Unit) |
inline ListBuilder |
ListBuilderDsl.row(buildRow: RowBuilderDsl.() -> Unit) |
inline GridRowBuilder |
GridRowBuilderDsl.seeMoreCell(buildCell: CellBuilderDsl.() -> Unit) |
inline ListBuilder |
ListBuilderDsl.seeMoreRow(buildRow: RowBuilderDsl.() -> Unit) |
Top-level functions
list
inline fun list(context: Context, uri: Uri, ttl: Long, addRows: ListBuilderDsl.() -> Unit): Slice
Reduces verbosity required to build a Slice in Kotlin. Usage example:
val slice = list(context = context, uri = testUri, ttl = ListBuilder.INFINITY) {
gridRow {
setPrimaryAction(action)
cell {
addTitleText("Title 1")
addImage(createIcon(R.drawable.ic_android_black_24dp), ListBuilder.SMALL_IMAGE)
addText("Text 1")
}
cell {
addTitleText("Title 2")
addImage(createIcon(R.drawable.ic_android_black_24dp), ListBuilder.SMALL_IMAGE)
addText("Text 2")
}
}
row {
setTitle("Title")
setSubtitle("Subtitle")
setPrimaryAction(sliceAction)
}
}
| See also | |
|---|---|
build |
tapSliceAction
fun tapSliceAction(
pendingIntent: PendingIntent,
icon: IconCompat,
imageMode: Int = ICON_IMAGE,
title: CharSequence
): SliceAction
Factory method to build a tappable SliceAction.
toggleSliceAction
fun toggleSliceAction(
pendingIntent: PendingIntent,
icon: IconCompat? = null,
title: CharSequence,
isChecked: Boolean
): SliceAction
Factory method to build a toggleable SliceAction.
Extension functions
cell
inline fun GridRowBuilderDsl.cell(buildCell: CellBuilderDsl.() -> Unit): GridRowBuilder
| See also | |
|---|---|
addCell |
gridRow
inline fun ListBuilderDsl.gridRow(buildGrid: GridRowBuilderDsl.() -> Unit): ListBuilder
| See also | |
|---|---|
addGridRow |
header
inline fun ListBuilderDsl.header(buildHeader: HeaderBuilderDsl.() -> Unit): ListBuilder
| See also | |
|---|---|
setHeader |
inputRange
inline fun ListBuilderDsl.inputRange(buildInputRange: InputRangeBuilderDsl.() -> Unit): ListBuilder
| See also | |
|---|---|
addInputRange |
range
inline fun ListBuilderDsl.range(buildRange: RangeBuilderDsl.() -> Unit): ListBuilder
| See also | |
|---|---|
addRange |
seeMoreCell
inline fun GridRowBuilderDsl.seeMoreCell(buildCell: CellBuilderDsl.() -> Unit): GridRowBuilder
| See also | |
|---|---|
setSeeMoreCell |
seeMoreRow
inline fun ListBuilderDsl.seeMoreRow(buildRow: RowBuilderDsl.() -> Unit): ListBuilder
| See also | |
|---|---|
setSeeMoreRow |