Demonstrates how to use ExplicitLayout to: Note: If you want to define layout variants without using a properties file, see Ratio Trigger example.

Possible uses of these features include:

Instructions

The "layout.properties" file used in this example defines three layout variants: default (null), "middle" and "right". To switch between variants, type the variant name (or blank for default) in the text field provided in the Constraints Editor and hit [enter] or click Layout

You can also edit the constraints in the Constraints Editor. A constraints attribute key has the format component_name.attribute for the default variant or component_name.variant.attribute for the specified variant. The constraints attribute values are specified using the ExplicitLayout API and a syntax similar to Java language. The main differences include:

For further details, see API documentaion.

Keys are sorted alphabetically. To insert a new key, use the empty row at the bottom of the table. To delete a key, delete the text in the corresponding cell and hit [Enter]. To update the layout using your modified properties, enter the variant in the text field provided and click Layout in Constraints Editor

There are two common types of error you may get when editing constraints:

To disgard changes and reload the layout.properties file, click Reload in Constraints Editor