Bixby Developer Center

References

macro

optionalvalue required

Defines a layout, a portion of a layout, or a dialog with a macro. A macro that contains a dialog template can be used anywhere a dialog template is supported. Similarly, a macro that contains a layout component can be used anywhere the component it produces can be used. A macro can also be used in a different macro.

You can use this macro to define repeatable portions of your layouts and dialog, such as a card or a cell for a specific structure or entire portions of a Bixby View. You define the exact parameters within a macro using a macro-def. For more information, see Reusing Content with Macros.

Unlike in a layout-macro, you can define multiple components within a single macro.

Note

Be aware of which components you are adding to your layouts and layout macros, because different components are available under different views. If you call a layout or layout macro in a view and that layout specifies a component that the view does not support, Bixby Developer Studio will throw an error. Similarly, you should consider which layout macros are being called within a layout itself. The same layout macro invoked in one component might not be valid if used within a different component, as the list of supported child components could differ.

You can read the Designing with Bixby Views Design Guide and the Building Bixby Views (UI) Developers' Guide to check if your layout is using the correct components for that moment and that view.

Example

result-view {
match: MyConcept(this)

render {
layout {
macro (my-macro) {
param (myParam) {
expression (this)
}
}
}
}
}
result-view {
match {
Receipt (receipt) {
min (Required)
max (One)
}
}

message {
macro (RECEIPT_RESULT) {
param (receipt) {
expression (receipt)
}
}
}

render {
layout {
macro (receipt-header) {
param (receipt) {
expression (receipt)
}
}
macro (receipt-contact-information) {
param (receipt) {
expression (receipt)
}
}
macro (receipt-order-total) {
param (receipt) {
expression (receipt)
}
}
}
}
}

View master on GitHub

Child Keys

param
optional
Parameter to which the argument (specified as a child) should bind