Class CollapseControl

CollapseControl

Özelleştirilebilir daraltma ve genişletme kontrolü.

Google Chat uygulamalarında kullanılabilir. Google Workspace eklentileri için geliştirici önizlemesinde.

const collapseButton =
    CardService.newTextButton()
        .setTextButtonStyle(CardService.TextButtonStyle.BORDERLESS)
        .setText('Collapse');

const expandButton =
    CardService.newImageButton()
        .setImageButtonStyle(CardService.ImageButtonStyle.FILLED);

const collapseControl =
    CardService.newCollapseControl()
        .setHorizontalAlign(CardService.HorizontalAlignment.END)
        .setExpandButton(expandButton)
        .setCollapseButton(collapseButton);

Yöntemler

YöntemDönüş türüKısa açıklama
setCollapseButton(button)CollapseControl"Daha az göster" düğmesi için gösterilen Button öğesini ayarlar.
setExpandButton(button)CollapseControl"Daha fazla göster" düğmesi için gösterilen Button öğesini ayarlar.
setHorizontalAlign(horizontalAlignment)CollapseControlCollapseControl cihazının HorizontalAlignment değerini ayarlar.

Ayrıntılı belgeler

setCollapseButton(button)

"Daha az göster" düğmesi için gösterilen Button öğesini ayarlar. İsteğe bağlı.
Daraltma düğmesiyle birlikte ayarlanmalıdır.

const collapseButton =
    CardService.newTextButton().setText('Collapse');

const collapseControl =
    CardService.newCollapseControl()
        .setCollapseButton(collapseButton);

Parametreler

AdTürAçıklama
buttonButtonAyarlanacak daraltma düğmesi.

Return

CollapseControl: Zincirleme için kullanılan bu nesne.


setExpandButton(button)

"Daha fazla göster" düğmesi için gösterilen Button öğesini ayarlar. İsteğe bağlı.
Daraltma düğmesiyle birlikte ayarlanmalıdır.

const expandButton =
    CardService.newTextButton().setText('Expand');

const collapseControl =
    CardService.newCollapseControl()
        .setExpandButton(expandButton);

Parametreler

AdTürAçıklama
buttonButtonAyarlanacak genişletme düğmesi.

Return

CollapseControl: Zincirleme için kullanılan bu nesne.


setHorizontalAlign(horizontalAlignment)

CollapseControl cihazının HorizontalAlignment değerini ayarlar. İsteğe bağlı. *

const collapseControl = CardService.newCollapseControl().setHorizontalAlign(
    CardService.HorizontalAlignment.START,
);

Parametreler

AdTürAçıklama
horizontalAlignmentHorizontalAlignmentCollapseControl widget'ının yatay hizalaması.

Return

CollapseControl: Zincirleme için kullanılan bu nesne.