Support for right-to-left (RTL) layouts in Litho follows a similar pattern to Android's RTL support. In order to make your component RTL-ready, simply use the
END variants of padding and margin parameters instead of
RIGHT. All the rest will be handled by the layout system automatically.
For example, here's a
The layout system will automatically follow the layout direction defined by Android's resource system. You can also make absolute positions RTL-aware by using the analogous start/end variants for position attributes:
In the example above, the image component will be automatically placed 10 pixels from the right edge of its parent when RTL is enabled.