Class Grid (0.1.0)

public final class Grid extends GeneratedMessageV3 implements GridOrBuilder

Displays a grid with a collection of items. Items can only include text or images. For responsive columns, or to include more than text or images, use Columns. For an example in Google Chat apps, see Grid.

A grid supports any number of columns and items. The number of rows is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows.

Google Workspace Add-ons and Chat apps:

For example, the following JSON creates a 2 column grid with a single item:

<code><code> "grid": { "title": "A fine collection of items", "columnCount": 2, "borderStyle": { "type": "STROKE", "cornerRadius": 4 }, "items": [ { "image": { "imageUri": "https://www.example.com/image.png", "cropStyle": { "type": "SQUARE" }, "borderStyle": { "type": "STROKE" } }, "title": "An item", "textAlignment": "CENTER" } ], "onClick": { "openLink": { "url": "https://www.example.com" } } } </code></code>

Protobuf type google.apps.card.v1.Grid

Implements

GridOrBuilder

Static Fields

BORDER_STYLE_FIELD_NUMBER

public static final int BORDER_STYLE_FIELD_NUMBER
Field Value
TypeDescription
int

COLUMN_COUNT_FIELD_NUMBER

public static final int COLUMN_COUNT_FIELD_NUMBER
Field Value
TypeDescription
int

ITEMS_FIELD_NUMBER

public static final int ITEMS_FIELD_NUMBER
Field Value
TypeDescription
int

ON_CLICK_FIELD_NUMBER

public static final int ON_CLICK_FIELD_NUMBER
Field Value
TypeDescription
int

TITLE_FIELD_NUMBER

public static final int TITLE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Grid getDefaultInstance()
Returns
TypeDescription
Grid

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Grid.Builder newBuilder()
Returns
TypeDescription
Grid.Builder

newBuilder(Grid prototype)

public static Grid.Builder newBuilder(Grid prototype)
Parameter
NameDescription
prototypeGrid
Returns
TypeDescription
Grid.Builder

parseDelimitedFrom(InputStream input)

public static Grid parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Grid
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Grid parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Grid
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Grid parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Grid
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Grid parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Grid
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Grid parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Grid
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Grid parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Grid
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Grid parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Grid
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Grid parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Grid
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Grid parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Grid
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Grid parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Grid
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Grid parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Grid
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Grid parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Grid
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Grid> parser()
Returns
TypeDescription
Parser<Grid>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getBorderStyle()

public BorderStyle getBorderStyle()

The border style to apply to each grid item.

.google.apps.card.v1.BorderStyle border_style = 3;

Returns
TypeDescription
BorderStyle

The borderStyle.

getBorderStyleOrBuilder()

public BorderStyleOrBuilder getBorderStyleOrBuilder()

The border style to apply to each grid item.

.google.apps.card.v1.BorderStyle border_style = 3;

Returns
TypeDescription
BorderStyleOrBuilder

getColumnCount()

public int getColumnCount()

The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion).

int32 column_count = 4;

Returns
TypeDescription
int

The columnCount.

getDefaultInstanceForType()

public Grid getDefaultInstanceForType()
Returns
TypeDescription
Grid

getItems(int index)

public Grid.GridItem getItems(int index)

The items to display in the grid.

repeated .google.apps.card.v1.Grid.GridItem items = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Grid.GridItem

getItemsCount()

public int getItemsCount()

The items to display in the grid.

repeated .google.apps.card.v1.Grid.GridItem items = 2;

Returns
TypeDescription
int

getItemsList()

public List<Grid.GridItem> getItemsList()

The items to display in the grid.

repeated .google.apps.card.v1.Grid.GridItem items = 2;

Returns
TypeDescription
List<GridItem>

getItemsOrBuilder(int index)

public Grid.GridItemOrBuilder getItemsOrBuilder(int index)

The items to display in the grid.

repeated .google.apps.card.v1.Grid.GridItem items = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Grid.GridItemOrBuilder

getItemsOrBuilderList()

public List<? extends Grid.GridItemOrBuilder> getItemsOrBuilderList()

The items to display in the grid.

repeated .google.apps.card.v1.Grid.GridItem items = 2;

Returns
TypeDescription
List<? extends com.google.apps.card.v1.Grid.GridItemOrBuilder>

getOnClick()

public OnClick getOnClick()

This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.

.google.apps.card.v1.OnClick on_click = 5;

Returns
TypeDescription
OnClick

The onClick.

getOnClickOrBuilder()

public OnClickOrBuilder getOnClickOrBuilder()

This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.

.google.apps.card.v1.OnClick on_click = 5;

Returns
TypeDescription
OnClickOrBuilder

getParserForType()

public Parser<Grid> getParserForType()
Returns
TypeDescription
Parser<Grid>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getTitle()

public String getTitle()

The text that displays in the grid header.

string title = 1;

Returns
TypeDescription
String

The title.

getTitleBytes()

public ByteString getTitleBytes()

The text that displays in the grid header.

string title = 1;

Returns
TypeDescription
ByteString

The bytes for title.

hasBorderStyle()

public boolean hasBorderStyle()

The border style to apply to each grid item.

.google.apps.card.v1.BorderStyle border_style = 3;

Returns
TypeDescription
boolean

Whether the borderStyle field is set.

hasOnClick()

public boolean hasOnClick()

This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters.

.google.apps.card.v1.OnClick on_click = 5;

Returns
TypeDescription
boolean

Whether the onClick field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Grid.Builder newBuilderForType()
Returns
TypeDescription
Grid.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Grid.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Grid.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Grid.Builder toBuilder()
Returns
TypeDescription
Grid.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException