Posted by The Android Group
As one of the broadly used social media platforms, Twitter is all the time looking for methods to raised join its customers. On the identical time, so as to effectively construct new options whereas sustaining current ones, builders want supportive infrastructure. The Twitter engineering workforce turned to Jetpack Compose to kick-start a a lot wanted overhaul of the app’s UI basis. With Compose, builders can simply discover and use the suitable APIs, fluidly type and modularize parts, and finally construct extra with much less code.
Twitter launches UI overhaul
A handful of groups such because the Android Consumer UI workforce, Buyer Acquisition, Twitter Blue, and Communities groups revamped their improvement processes, inspiring pleasure amongst Twitter’s engineers. “A number of groups at Twitter have adopted Compose of their day by day workflows,” mentioned Sneha Patil, senior software program engineer and technical lead on the Communities workforce for Twitter for Android. By eradicating the work of making and establishing customized theming and attributes, Compose made writing features and implementing design necessities considerably sooner and extra easy than what they skilled with Views. Jetpack Compose enabled these groups to work sooner and extra successfully, guarantee reusability of their code, and simply onboard new engineers.
Revitalizing the event course of
Creating dynamic content material is easy with Compose. The Twitter workforce used the LazyColumn composable to construct UI with out the necessity for an Adapter or ViewHolder, simplifying the method of writing code that seamlessly brings layouts, themes, and kinds to life. With fewer strains to write down, improvement groups at Twitter decreased their boilerplate, skilled much less bugs throughout improvement and releases, enabled UI experimentation, and sped up the testing processes. These enhancements heightened productiveness so builders may spend extra time constructing what makes Twitter distinctive.
In addition they used Compose to construct stateless parts which are reusable throughout the app. The pliability of Compose made it simpler and sooner to satisfy design necessities, making the setup of theming and styling simpler for each new and skilled engineers to work with.
Constructing new options utilizing Compose
Given the enhancements skilled, they determined to construct a whole new function utilizing Compose. They constructed the Communities function, Twitter’s devoted area the place customers can have interaction in discussions they care about most, from the bottom up utilizing Compose. Based mostly on the groups’ earlier expertise utilizing Views for different options, constructing with Compose was a lot sooner and so they had much less bugs. “It was like magic,” mentioned Sneha, “It’s a recreation changer for the way we are able to develop on Android with Compose.”
Compose boosts improvement output
Compose boosted the rate and effectivity of Twitter engineers’ UI improvement. Builders simply integrated and constructed with Compose, which made it simpler for them to modularize code, reuse parts, and break down dependencies. The workforce recurrently makes use of UI experimentation, and Compose helped improve their confidence in realizing what the parts that react to person interactions, information updates, and totally different display sizes will appear like in manufacturing.
These groups’ preliminary success with Compose impressed different improvement groups at Twitter to comply with go well with. Now, even engineers engaged on advanced legacy parts are wanting into adopting it.
General, Compose has not solely eliminated lots of the obstacles the workforce skilled in Views — it additionally added enjoyment into the workflow, with some builders able to abandon outdated strategies for good. “I’m excited to write down extra Compose and by no means contact an XML format once more,” mentioned Yoali Sotomayor Baqueiro, software program engineer for Android Consumer UI at Twitter. “It makes growing UI not simply simpler but in addition rather more enjoyable and intuitive.”
Optimize your UI improvement with Compose.