Facebook open-sources framework for smoother Android apps

From InfoWorld: Facebook is open-sourcing its Litho framework for smooth UI performance on Android mobile applications.

The framework supports native development and leverages the declarative model used in Facebook's React UI library and the Yoga layout system. Layout operations are decoupled from Android views, which "allows us to move the CPU-intensive measure and layout operations to the background thread, saving milliseconds," said Facebook software engineers Pasquale Anatriello and Marco Cova.

Litho's declarative API frees developers from having to hand-optimize UIs, the engineers said. Components are laid out ahead of time in a background thread and rendered incrementally to improve performance. Facebook already has had a similar offering for Apple iOS mobile development with its ComponentKit framework.

Through Litho, complex views are broken down into smaller pieces, such as text, images, and videos, and are rendered incrementally. This spreads the work across multiple frames and recycles smaller pieces that can be recombined, thus reducing the number of views that have to be created and stored in memory. "Since being used across our apps, Litho has delivered great results, including an improvement in scroll performance of up to 35 percent, better memory behavior with complex lists, and easier-to-test UI code," the engineers said.

View: Article @ Source Site