Class Columns.Builder (2.49.0)

public static final class Columns.Builder extends GeneratedMessageV3.Builder<Columns.Builder> implements ColumnsOrBuilder

The Columns widget displays up to 2 columns in a card or dialog. You can add widgets to each column; the widgets appear in the order that they are specified. For an example in Google Chat apps, see Display cards and dialogs in columns.

The height of each column is determined by the taller column. For example, if the first column is taller than the second column, both columns have the height of the first column. Because each column can contain a different number of widgets, you can't define rows or align widgets between the columns.

Columns are displayed side-by-side. You can customize the width of each column using the HorizontalSizeStyle field. If the user's screen width is too narrow, the second column wraps below the first:

  • On web, the second column wraps if the screen width is less than or equal to 480 pixels.
  • On iOS devices, the second column wraps if the screen width is less than or equal to 300 pt.
  • On Android devices, the second column wraps if the screen width is less than or equal to 320 dp.

    To include more than 2 columns, or to use rows, use the Grid widget.

    Google Workspace Add-ons and Chat apps: Columns for Google Workspace Add-ons are in Developer Preview.

Protobuf type google.apps.card.v1.Columns

Implements

ColumnsOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllColumnItems(Iterable<? extends Columns.Column> values)

public Columns.Builder addAllColumnItems(Iterable<? extends Columns.Column> values)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameter
Name Description
values Iterable<? extends com.google.apps.card.v1.Columns.Column>
Returns
Type Description
Columns.Builder

addColumnItems(Columns.Column value)

public Columns.Builder addColumnItems(Columns.Column value)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameter
Name Description
value Columns.Column
Returns
Type Description
Columns.Builder

addColumnItems(Columns.Column.Builder builderForValue)

public Columns.Builder addColumnItems(Columns.Column.Builder builderForValue)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameter
Name Description
builderForValue Columns.Column.Builder
Returns
Type Description
Columns.Builder

addColumnItems(int index, Columns.Column value)

public Columns.Builder addColumnItems(int index, Columns.Column value)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameters
Name Description
index int
value Columns.Column
Returns
Type Description
Columns.Builder

addColumnItems(int index, Columns.Column.Builder builderForValue)

public Columns.Builder addColumnItems(int index, Columns.Column.Builder builderForValue)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameters
Name Description
index int
builderForValue Columns.Column.Builder
Returns
Type Description
Columns.Builder

addColumnItemsBuilder()

public Columns.Column.Builder addColumnItemsBuilder()

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Returns
Type Description
Columns.Column.Builder

addColumnItemsBuilder(int index)

public Columns.Column.Builder addColumnItemsBuilder(int index)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameter
Name Description
index int
Returns
Type Description
Columns.Column.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Columns.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Columns.Builder
Overrides

build()

public Columns build()
Returns
Type Description
Columns

buildPartial()

public Columns buildPartial()
Returns
Type Description
Columns

clear()

public Columns.Builder clear()
Returns
Type Description
Columns.Builder
Overrides

clearColumnItems()

public Columns.Builder clearColumnItems()

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Returns
Type Description
Columns.Builder

clearField(Descriptors.FieldDescriptor field)

public Columns.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Columns.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public Columns.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Columns.Builder
Overrides

clone()

public Columns.Builder clone()
Returns
Type Description
Columns.Builder
Overrides

getColumnItems(int index)

public Columns.Column getColumnItems(int index)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameter
Name Description
index int
Returns
Type Description
Columns.Column

getColumnItemsBuilder(int index)

public Columns.Column.Builder getColumnItemsBuilder(int index)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameter
Name Description
index int
Returns
Type Description
Columns.Column.Builder

getColumnItemsBuilderList()

public List<Columns.Column.Builder> getColumnItemsBuilderList()

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Returns
Type Description
List<Builder>

getColumnItemsCount()

public int getColumnItemsCount()

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Returns
Type Description
int

getColumnItemsList()

public List<Columns.Column> getColumnItemsList()

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Returns
Type Description
List<Column>

getColumnItemsOrBuilder(int index)

public Columns.ColumnOrBuilder getColumnItemsOrBuilder(int index)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameter
Name Description
index int
Returns
Type Description
Columns.ColumnOrBuilder

getColumnItemsOrBuilderList()

public List<? extends Columns.ColumnOrBuilder> getColumnItemsOrBuilderList()

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Returns
Type Description
List<? extends com.google.apps.card.v1.Columns.ColumnOrBuilder>

getDefaultInstanceForType()

public Columns getDefaultInstanceForType()
Returns
Type Description
Columns

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Columns other)

public Columns.Builder mergeFrom(Columns other)
Parameter
Name Description
other Columns
Returns
Type Description
Columns.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Columns.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Columns.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Columns.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Columns.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Columns.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Columns.Builder
Overrides

removeColumnItems(int index)

public Columns.Builder removeColumnItems(int index)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameter
Name Description
index int
Returns
Type Description
Columns.Builder

setColumnItems(int index, Columns.Column value)

public Columns.Builder setColumnItems(int index, Columns.Column value)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameters
Name Description
index int
value Columns.Column
Returns
Type Description
Columns.Builder

setColumnItems(int index, Columns.Column.Builder builderForValue)

public Columns.Builder setColumnItems(int index, Columns.Column.Builder builderForValue)

An array of columns. You can include up to 2 columns in a card or dialog.

repeated .google.apps.card.v1.Columns.Column column_items = 2;

Parameters
Name Description
index int
builderForValue Columns.Column.Builder
Returns
Type Description
Columns.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Columns.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Columns.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Columns.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Columns.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Columns.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Columns.Builder
Overrides