Beagle v1.6 is no longer actively maintained. The documented version you are viewing may contain deprecated functionality. For up-to-date documentation, see the latest version .
Operators | Example | Action |
---|---|---|
condition | “@{condition()}” | Conditional operator that evaluates two elements and verifies which condition is true. |
not | “@{not()}” | negation operator that has as input only one value and its function is invert this value. |
and | “@{and()}” | Operator that receives two inputs and it has a TRUE value, if the two values of the operation inputs are TRUE, if not the result is FALSE. |
or | “@{or()}” | Operator that receives two inputs and it the result it a TRUE value. If only ONE of the two input values are TRUE, if not the result is FALSE. |
Here is an example of a screen that uses two logical operation condition
and or
, if the result of the condition or
is true, the text of the component text becomes true, if it is false it attibutes the value false to the text:
fun screen() = Screen(
navigationBar = NavigationBar(title = "Operations", showBackButton = true),
child = Container(
children = listOf(
Text(text = "The text in green bellow will show if the result of `TRUE OR FALSE"),
Text(
expressionOf("@{condition(or(true, false), 'true', 'false')}")
).applyStyle(Style(backgroundColor = "#00FF00"))
)
)
)
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.