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
Inheritance
Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > GridImplements
GridOrBuilderStatic Fields
BORDER_STYLE_FIELD_NUMBER
public
static
final
int
BORDER_STYLE_FIELD_NUMBER
COLUMN_COUNT_FIELD_NUMBER
public
static
final
int
COLUMN_COUNT_FIELD_NUMBER
ITEMS_FIELD_NUMBER
public
static
final
int
ITEMS_FIELD_NUMBER
ON_CLICK_FIELD_NUMBER
public
static
final
int
ON_CLICK_FIELD_NUMBER
TITLE_FIELD_NUMBER
public
static
final
int
TITLE_FIELD_NUMBER
Static Methods
getDefaultInstance()
public
static
Grid
getDefaultInstance
()
getDescriptor()
public
static
final
Descriptors
.
Descriptor
getDescriptor
()
newBuilder()
public
static
Grid
.
Builder
newBuilder
()
newBuilder(Grid prototype)
public
static
Grid
.
Builder
newBuilder
(
Grid
prototype
)
parseDelimitedFrom(InputStream input)
public
static
Grid
parseDelimitedFrom
(
InputStream
input
)
parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Grid
parseDelimitedFrom
(
InputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(byte[] data)
public
static
Grid
parseFrom
(
byte
[]
data
)
data
byte
[]
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public
static
Grid
parseFrom
(
byte
[]
data
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(ByteString data)
public
static
Grid
parseFrom
(
ByteString
data
)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public
static
Grid
parseFrom
(
ByteString
data
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(CodedInputStream input)
public
static
Grid
parseFrom
(
CodedInputStream
input
)
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Grid
parseFrom
(
CodedInputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(InputStream input)
public
static
Grid
parseFrom
(
InputStream
input
)
parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Grid
parseFrom
(
InputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(ByteBuffer data)
public
static
Grid
parseFrom
(
ByteBuffer
data
)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public
static
Grid
parseFrom
(
ByteBuffer
data
,
ExtensionRegistryLite
extensionRegistry
)
parser()
public
static
Parser<Grid>
parser
()
Methods
equals(Object obj)
public
boolean
equals
(
Object
obj
)
getBorderStyle()
public
BorderStyle
getBorderStyle
()
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3;
getBorderStyleOrBuilder()
public
BorderStyleOrBuilder
getBorderStyleOrBuilder
()
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3;
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;
getDefaultInstanceForType()
public
Grid
getDefaultInstanceForType
()
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;
getItemsCount()
public
int
getItemsCount
()
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;
getItemsList()
public
List<Grid
.
GridItem
>
getItemsList
()
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;
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;
getItemsOrBuilderList()
public
List
< ?
extends
Grid
.
GridItemOrBuilder
>
getItemsOrBuilderList
()
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;
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;
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;
getParserForType()
public
Parser<Grid>
getParserForType
()
getSerializedSize()
public
int
getSerializedSize
()
getTitle()
public
String
getTitle
()
The text that displays in the grid header.
string title = 1;
getTitleBytes()
public
ByteString
getTitleBytes
()
The text that displays in the grid header.
string title = 1;
hasBorderStyle()
public
boolean
hasBorderStyle
()
The border style to apply to each grid item.
.google.apps.card.v1.BorderStyle border_style = 3;
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;
hashCode()
public
int
hashCode
()
internalGetFieldAccessorTable()
protected
GeneratedMessageV3
.
FieldAccessorTable
internalGetFieldAccessorTable
()
isInitialized()
public
final
boolean
isInitialized
()
newBuilderForType()
public
Grid
.
Builder
newBuilderForType
()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected
Grid
.
Builder
newBuilderForType
(
GeneratedMessageV3
.
BuilderParent
parent
)
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected
Object
newInstance
(
GeneratedMessageV3
.
UnusedPrivateParameter
unused
)
toBuilder()
public
Grid
.
Builder
toBuilder
()
writeTo(CodedOutputStream output)
public
void
writeTo
(
CodedOutputStream
output
)