A slice is a piece of templated app content that can be presented outside of the app providing
the slice in a SliceView. To provide a slice you should implement a
SliceProvider and use ListBuilder to construct your slice when
SliceProvider.onBindSlice(Uri) is called.

ListBuilder allows you to construct a slice made up of rows of content. The row types that
ListBuilder supports are:

ListBuilder.HeaderBuilder - The first row of your slice should be a header. The header
supports a title, subtitle, and tappable row action. A header can also have a summary of the
contents of the slice which can be shown when not all of the slice can be displayed.

Slices are meant to be presented outside of the app providing them, the slice presenter could be
an Android system surface or another application. The presenter will normally use a
SliceView to display a slice. SliceView supports a couple of
different modes. These modes are not controlled by the app providing the slice, but
rather by the surface that is presenting the slice. To ensure your slice is presented
correctly you should consider the different modes SliceView supports:

SliceView.MODE_SMALL - Only the first row of content is
displayed in small format, normally this will be the header. If no header was set, then the
first row will be used and may appear differently depending on the row type and the
configuration of SliceView.

SliceView.MODE_LARGE - As many rows of content are shown
as possible. If the presenter of the slice allows scrolling then all rows of content will
be displayed in a scrollable view.

In addition to rows of content, ListBuilder can also have SliceActions added to
it. These actions may appear differently on your slice depending on how
SliceView is configured. Normally the actions appear as icons in
the header of the slice.

How much content to add

There is no limit to the number of rows added to ListBuilder, however, the contents of a slice
should be related to a primary task, action, or set of information. For example: it might make
sense for a slice to manage wi-fi state to have a row for each available network, this might
result in a large number of rows but each of these rows serve utility for the primary purpose
of the slice which is managing wi-fi.

Note that scrolling on SliceView can be disabled, in which case only the header and one or two
rows of content may be shown for your slice. If your slice contains many rows of content to
scroll through (e.g. list of wifi networks), consider using
setSeeMoreAction(PendingIntent) to provide a link to open the activity associated with
the content.

ListBuilder

A slice requires an associated time-to-live, i.e. how long the data contained in the slice
can remain fresh. If your slice has content that is not time sensitive, set Duration
to null and the TTL will be INFINITY.

Public methods

addAction

Actions added with this method are grouped together on the list template and represented
as tappable icons or images. These actions may appear differently on the slice depending on
how the SliceView is configured. Generally these actions will
be displayed in the order they were added, however, if not all actions can be displayed
then actions with a higher priority may be shown first.

build

Note that a ListBuilder requires a row containing a piece of text that is not created
from a GridRowBuilder. If the first row added does not fulfill this requirement,
build the slice will throw IllegalStateException.

Note that a ListBuilder requires a primary action, this can be set on any of the rows added
to the list. If a primary action has not been set on any of the rows, building this slice
will throw IllegalStateException.

setHeader

Sets a header for this list builder. A list can have only one header. Setting a header allows
some flexibility in what's displayed in your slice when SliceView displays in
SliceView.MODE_SMALL and
SliceView.MODE_SHORTCUT.

setSeeMoreAction

If all content in a slice cannot be shown, a "see more" affordance may be displayed where
the content is cut off. The action added here should take the user to an activity to see
all of the content, and will be invoked when the "see more" affordance is tapped.

Only one see more affordance can be added, this throws IllegalStateException if
a row or action has been previously added.

setSeeMoreRow

If all content in a slice cannot be shown, the row added here may be displayed where the
content is cut off. This row should have an affordance to take the user to an activity to
see all of the content.

This method should only be used if you want to display a customized row to indicate more
content, consider using setSeeMoreAction(PendingIntent) otherwise. If you do
choose to specify a custom row, the row should have a content intent or action end item
specified to take the user to an activity to see all of the content. The row added here
will only appear when not all content can be displayed and it will not be styled any
differently from row built by ListBuilder.RowBuilder normally.

Only one see more affordance can be added, this throws IllegalStateException if
a row or action has been previously added.