ELI5: Litho – Simplifying Consumer Interface for Android

In this post we discuss Litho, a framework for creating efficient user interfaces (UI) for Android. If you would like to watch a video on this subject, read an episode of the ELI5 series about this open source project on our Facebook Open Source YouTube channel.

Why Litho?

Most mobile apps these days look pretty similar: endless scrolling feeds of photos, videos, and text. There are many moving parts to make sure that everything on your screen appears correctly. Scrolling on mobile devices is not a trivial problem with large apps. Think of the news feed in the Facebook Android app – our developers have put many technical hours into making scrolling a seamless experience and optimizing all possible statuses for the user. Fortunately, Litho can make solving this problem easier for you.

Litho is a declarative UI framework for Android. The framework brings UI components into native Android development. This approach allows developers to break their UI into independent pieces, making testing, reusing, and creating new elements much easier. With Litho, developers can concentrate on the implementation of their ideas and not on the structure of their user interface. With Litho, developers only need to sketch the layout and the framework takes care of the rest.

The basic principles of Litho are performance and scalability. Thanks to the asynchronous layout feature, Android apps can measure and process the user interface in advance without blocking the UI thread, the main thread of app execution.

Litho uses an open source Facebook project, Yoga, which allows for a flat hierarchy of views. This gives Litho users additional optimization in their scrolling performance. If you want to learn more about yoga, check out another ELI5 blog post.

Where is it used?

Litho was first released to the public in 2017. It has been used in many of Facebook’s Android apps such as the Facebook app, Messenger, Facebook Lite and Workplace.

Where can i learn more?

To learn more about Litho, visit their website. It contains documentation and tutorials to get you started with the project. If you want to get in touch with the community, you can join the grid channel or contact the team on Twitter.

If you’d like to see more content about Litho, let us know on our YouTube channel or tweet us at.

About the ELI5 series

In a series of short videos (around 1 minute long) one of our developer attorneys on the Facebook Open Source team explains a Facebook Open Source project in a way that is easy to understand and use.

For each of these videos we are writing an accompanying blog post (like the one you are reading right now) that you can find on our YouTube channel.

To learn more about Facebook Open Source, visit our Open Source website, subscribe to our YouTube channel, or follow us on Twitter and Facebook.

Would you like to work with open source on Facebook? Check out our open source related job postings on our careers page by taking this short survey.

Comments are closed.