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
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

getDescriptor()

  public 
  
 static 
  
 final 
  
 Descriptors 
 . 
 Descriptor 
  
 getDescriptor 
 () 
 
Returns
Type
Description

newBuilder()

  public 
  
 static 
  
 Grid 
 . 
 Builder 
  
 newBuilder 
 () 
 
Returns
Type
Description

newBuilder(Grid prototype)

  public 
  
 static 
  
 Grid 
 . 
 Builder 
  
 newBuilder 
 ( 
 Grid 
  
 prototype 
 ) 
 
Parameter
Name
Description
prototype
Returns
Type
Description

parseDelimitedFrom(InputStream input)

  public 
  
 static 
  
 Grid 
  
 parseDelimitedFrom 
 ( 
 InputStream 
  
 input 
 ) 
 
Parameter
Name
Description
input
Returns
Type
Description
Exceptions
Type
Description

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Grid 
  
 parseDelimitedFrom 
 ( 
 InputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
input
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(byte[] data)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 byte 
 [] 
  
 data 
 ) 
 
Parameter
Name
Description
data
byte []
Returns
Type
Description
Exceptions
Type
Description

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 byte 
 [] 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
data
byte []
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(ByteString data)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 ByteString 
  
 data 
 ) 
 
Parameter
Name
Description
data
Returns
Type
Description
Exceptions
Type
Description

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 ByteString 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
data
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(CodedInputStream input)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 CodedInputStream 
  
 input 
 ) 
 
Parameter
Name
Description
Returns
Type
Description
Exceptions
Type
Description

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 CodedInputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(InputStream input)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 InputStream 
  
 input 
 ) 
 
Parameter
Name
Description
input
Returns
Type
Description
Exceptions
Type
Description

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 InputStream 
  
 input 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
input
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parseFrom(ByteBuffer data)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 ByteBuffer 
  
 data 
 ) 
 
Parameter
Name
Description
data
Returns
Type
Description
Exceptions
Type
Description

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

  public 
  
 static 
  
 Grid 
  
 parseFrom 
 ( 
 ByteBuffer 
  
 data 
 , 
  
 ExtensionRegistryLite 
  
 extensionRegistry 
 ) 
 
Parameters
Name
Description
data
extensionRegistry
Returns
Type
Description
Exceptions
Type
Description

parser()

  public 
  
 static 
  
 Parser<Grid> 
  
 parser 
 () 
 
Returns
Type
Description
Parser < Grid >

Methods

equals(Object obj)

  public 
  
 boolean 
  
 equals 
 ( 
 Object 
  
 obj 
 ) 
 
Parameter
Name
Description
obj
Returns
Type
Description
Overrides

getBorderStyle()

  public 
  
 BorderStyle 
  
 getBorderStyle 
 () 
 

The border style to apply to each grid item.

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

Returns
Type
Description

The borderStyle.

getBorderStyleOrBuilder()

  public 
  
 BorderStyleOrBuilder 
  
 getBorderStyleOrBuilder 
 () 
 

The border style to apply to each grid item.

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

Returns
Type
Description

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

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
Returns
Type
Description

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;

Returns
Type
Description

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
Returns
Type
Description

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

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
Type
Description

getParserForType()

  public 
  
 Parser<Grid> 
  
 getParserForType 
 () 
 
Returns
Type
Description
Parser < Grid >
Overrides

getSerializedSize()

  public 
  
 int 
  
 getSerializedSize 
 () 
 
Returns
Type
Description
int
Overrides

getTitle()

  public 
  
 String 
  
 getTitle 
 () 
 

The text that displays in the grid header.

string title = 1;

Returns
Type
Description

The title.

getTitleBytes()

  public 
  
 ByteString 
  
 getTitleBytes 
 () 
 

The text that displays in the grid header.

string title = 1;

Returns
Type
Description

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

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

Whether the onClick field is set.

hashCode()

  public 
  
 int 
  
 hashCode 
 () 
 
Returns
Type
Description
int
Overrides

internalGetFieldAccessorTable()

  protected 
  
 GeneratedMessageV3 
 . 
 FieldAccessorTable 
  
 internalGetFieldAccessorTable 
 () 
 
Returns
Type
Description
Overrides

isInitialized()

  public 
  
 final 
  
 boolean 
  
 isInitialized 
 () 
 
Returns
Type
Description
Overrides

newBuilderForType()

  public 
  
 Grid 
 . 
 Builder 
  
 newBuilderForType 
 () 
 
Returns
Type
Description

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

  protected 
  
 Grid 
 . 
 Builder 
  
 newBuilderForType 
 ( 
 GeneratedMessageV3 
 . 
 BuilderParent 
  
 parent 
 ) 
 
Parameter
Name
Description
parent
Returns
Type
Description
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

  protected 
  
 Object 
  
 newInstance 
 ( 
 GeneratedMessageV3 
 . 
 UnusedPrivateParameter 
  
 unused 
 ) 
 
Parameter
Name
Description
Returns
Type
Description
Overrides

toBuilder()

  public 
  
 Grid 
 . 
 Builder 
  
 toBuilder 
 () 
 
Returns
Type
Description

writeTo(CodedOutputStream output)

  public 
  
 void 
  
 writeTo 
 ( 
 CodedOutputStream 
  
 output 
 ) 
 
Parameter
Name
Description
Overrides
Exceptions
Type
Description
Create a Mobile Website
View Site in Mobile | Classic
Share by: