ListBuilderKt

public final class ListBuilderKt


Summary

Public methods

static final @NonNull ListBuilder
ListBuilderKt.gridRow(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull GridRowBuilderDslUnit> buildGrid
)
static final @NonNull ListBuilder
ListBuilderKt.header(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull HeaderBuilderDslUnit> buildHeader
)
static final @NonNull ListBuilder
ListBuilderKt.inputRange(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull InputRangeBuilderDslUnit> buildInputRange
)
static final @NonNull Slice
list(
    @NonNull Context context,
    @NonNull Uri uri,
    long ttl,
    @NonNull Function1<@NonNull ListBuilderDslUnit> addRows
)

Reduces verbosity required to build a Slice in Kotlin.

static final @NonNull ListBuilder
ListBuilderKt.range(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull RangeBuilderDslUnit> buildRange
)
static final @NonNull ListBuilder
ListBuilderKt.row(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull RowBuilderDslUnit> buildRow
)
static final @NonNull ListBuilder
ListBuilderKt.seeMoreRow(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull RowBuilderDslUnit> buildRow
)
static final @NonNull SliceAction
tapSliceAction(
    @NonNull PendingIntent pendingIntent,
    @NonNull IconCompat icon,
    @ListBuilder.ImageMode int imageMode,
    @NonNull CharSequence title
)

Factory method to build a tappable SliceAction.

static final @NonNull SliceAction
toggleSliceAction(
    @NonNull PendingIntent pendingIntent,
    @Nullable IconCompat icon,
    @NonNull CharSequence title,
    boolean isChecked
)

Factory method to build a toggleable SliceAction.

Public methods

ListBuilderKt.gridRow

@NonNull
public static final ListBuilder ListBuilderKt.gridRow(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull GridRowBuilderDslUnit> buildGrid
)
See also
addGridRow

ListBuilderKt.header

@NonNull
public static final ListBuilder ListBuilderKt.header(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull HeaderBuilderDslUnit> buildHeader
)
See also
setHeader

ListBuilderKt.inputRange

@NonNull
public static final ListBuilder ListBuilderKt.inputRange(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull InputRangeBuilderDslUnit> buildInputRange
)
See also
addInputRange

list

@NonNull
public static final Slice list(
    @NonNull Context context,
    @NonNull Uri uri,
    long ttl,
    @NonNull Function1<@NonNull ListBuilderDslUnit> addRows
)

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

ListBuilderKt.range

@NonNull
public static final ListBuilder ListBuilderKt.range(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull RangeBuilderDslUnit> buildRange
)
See also
addRange

ListBuilderKt.row

@NonNull
public static final ListBuilder ListBuilderKt.row(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull RowBuilderDslUnit> buildRow
)
See also
addRow

ListBuilderKt.seeMoreRow

@NonNull
public static final ListBuilder ListBuilderKt.seeMoreRow(
    @NonNull ListBuilderDsl receiver,
    @NonNull Function1<@NonNull RowBuilderDslUnit> buildRow
)
See also
setSeeMoreRow

tapSliceAction

@NonNull
public static final SliceAction tapSliceAction(
    @NonNull PendingIntent pendingIntent,
    @NonNull IconCompat icon,
    @ListBuilder.ImageMode int imageMode,
    @NonNull CharSequence title
)

Factory method to build a tappable SliceAction.

toggleSliceAction

@NonNull
public static final SliceAction toggleSliceAction(
    @NonNull PendingIntent pendingIntent,
    @Nullable IconCompat icon,
    @NonNull CharSequence title,
    boolean isChecked
)

Factory method to build a toggleable SliceAction.