Skip to content
Sasa Sekulic edited this page Apr 3, 2016 · 2 revisions

Value converters are methods that you can use to bind data to views, but in the format that the views natively don't understand so they cannot be bound directly.

There are currently two value converters in the library:

  1. ToFont converter, that sets the custom Typeface to the View (but you have to add fonts to the assets and register them with the FontManager - detailed guide here)

  2. ToVisibility converters, that converts a Boolean into a View.VISIBILITY, enabling you to bind a Boolean directly to the Visibility property of a View. It is used like this: {Visibility @= ToVisibility(ViewVisible)}, where ToVisibility is the converter's name and the ViewVisible is the name of the bound data or method (with added get prefix, so it becomes getViewVisible). You can also see the example code.