Class Columns (2.38.0)

public final class Columns extends GeneratedMessageV3 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 Fields

COLUMN_ITEMS_FIELD_NUMBER

public static final int COLUMN_ITEMS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Columns getDefaultInstance()
Returns
Type Description
Columns

getDescriptor()

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

newBuilder()

public static Columns.Builder newBuilder()
Returns
Type Description
Columns.Builder

newBuilder(Columns prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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

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

getParserForType()

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

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Columns.Builder newBuilderForType()
Returns
Type Description
Columns.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

public Columns.Builder toBuilder()
Returns
Type Description
Columns.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException