Class CollapseControl

CollapseControl

عنصر تحكّم قابل للتخصيص لتصغير المحتوى وتوسيعه

متاحة لتطبيقات Google Chat. في الإصدار التجريبي من إضافات Google Workspace

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

الطُرق

الطريقةنوع القيمة التي تم إرجاعهاوصف قصير
setCollapseButton(button)CollapseControlتضبط هذه السمة Button التي يتم عرضها لزر "إظهار محتوى أقل".
setExpandButton(button)CollapseControlتضبط هذه السمة Button الذي يتم عرضه لزر "عرض المزيد".
setHorizontalAlign(horizontalAlignment)CollapseControlتضبط هذه السمة HorizontalAlignment الخاصة بـ CollapseControl.

مستندات تفصيلية

setCollapseButton(button)

تضبط هذه السمة Button التي يتم عرضها لزر "إظهار محتوى أقل". اختياريّ.
يجب ضبط هذا الخيار مع زر التصغير.

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

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

المعلمات

الاسمالنوعالوصف
buttonButtonزر التصغير الذي سيتم ضبطه

الإرجاع

CollapseControl: هذا العنصر، للتسلسل


setExpandButton(button)

تضبط هذه السمة Button الذي يتم عرضه لزر "عرض المزيد". اختياريّ.
يجب ضبط هذا الخيار مع زر التصغير.

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

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

المعلمات

الاسمالنوعالوصف
buttonButtonزر التوسيع المطلوب ضبطه

الإرجاع

CollapseControl: هذا العنصر، للتسلسل


setHorizontalAlign(horizontalAlignment)

تضبط هذه السمة HorizontalAlignment الخاصة بـ CollapseControl. اختياريّ. *

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

المعلمات

الاسمالنوعالوصف
horizontalAlignmentHorizontalAlignmentالمحاذاة الأفقية للأداة CollapseControl

الإرجاع

CollapseControl: هذا العنصر، للتسلسل