Send feedback
Class Grid (0.1.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 0.1.0 keyboard_arrow_down
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
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
BORDER_STYLE_FIELD_NUMBER
public static final int BORDER_STYLE_FIELD_NUMBER
Field Value Type Description int
COLUMN_COUNT_FIELD_NUMBER
public static final int COLUMN_COUNT_FIELD_NUMBER
Field Value Type Description int
ITEMS_FIELD_NUMBER
public static final int ITEMS_FIELD_NUMBER
Field Value Type Description int
ON_CLICK_FIELD_NUMBER
public static final int ON_CLICK_FIELD_NUMBER
Field Value Type Description int
TITLE_FIELD_NUMBER
public static final int TITLE_FIELD_NUMBER
Field Value Type Description int
Static Methods
getDefaultInstance()
public static Grid getDefaultInstance ()
Returns Type Description Grid
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
newBuilder()
public static Grid . Builder newBuilder ()
newBuilder(Grid prototype)
public static Grid . Builder newBuilder ( Grid prototype )
Parameter Name Description prototype
Grid
public static Grid parseDelimitedFrom ( InputStream input )
Returns Type Description Grid
public static Grid parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
Returns Type Description Grid
parseFrom(byte[] data)
public static Grid parseFrom ( byte [] data )
Parameter Name Description data
byte []
Returns Type Description Grid
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Grid parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
Returns Type Description Grid
parseFrom(ByteString data)
public static Grid parseFrom ( ByteString data )
Returns Type Description Grid
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Grid parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
Returns Type Description Grid
public static Grid parseFrom ( CodedInputStream input )
Returns Type Description Grid
public static Grid parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
Returns Type Description Grid
public static Grid parseFrom ( InputStream input )
Returns Type Description Grid
public static Grid parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
Returns Type Description Grid
parseFrom(ByteBuffer data)
public static Grid parseFrom ( ByteBuffer data )
Returns Type Description Grid
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Grid parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
Returns Type Description Grid
parser()
public static Parser<Grid> parser ()
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter Name Description obj
Object
Overrides
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;
Returns Type Description int
The columnCount.
getDefaultInstanceForType()
public Grid getDefaultInstanceForType ()
Returns Type Description 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 Name Description index
int
getItemsCount()
public int getItemsCount ()
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;
Returns Type Description int
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;
Parameter Name Description index
int
getItemsOrBuilderList()
public List <? extends Grid . GridItemOrBuilder > getItemsOrBuilderList ()
The items to display in the grid.
repeated .google.apps.card.v1.Grid.GridItem items = 2;
Returns Type Description 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 Type Description 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;
getParserForType()
public Parser<Grid> getParserForType ()
Overrides
getSerializedSize()
public int getSerializedSize ()
Returns Type Description int
Overrides
getTitle()
The text that displays in the grid header.
string title = 1;
Returns Type Description String
The title.
getTitleBytes()
public ByteString getTitleBytes ()
The text that displays in the grid header.
string title = 1;
Returns Type Description 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 Type Description 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 Type Description boolean
Whether the onClick field is set.
hashCode()
Returns Type Description int
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
newBuilderForType()
public Grid . Builder newBuilderForType ()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Grid . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance ( GeneratedMessageV3 . UnusedPrivateParameter unused )
Overrides
toBuilder()
public Grid . Builder toBuilder ()
writeTo(CodedOutputStream output)
public void writeTo ( CodedOutputStream output )
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-14 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-14 UTC."],[],[]]