[ad_1]
Posted by Yasmine Evjen – Product Supervisor, and Florina Muntenescu – Developer Relations Engineer
Following its launch in July of 2023, Meta’s Threads turned probably the most quickly downloaded app ever with over 100 million downloads in its first week. Meta created the brand new text-based social media platform as a spot to construct connections and have significant conversations. To make sure the app was arrange for achievement at its launch and into the long run, Threads builders used Jetpack Compose, Android’s trendy declarative toolkit for constructing UI.
A better strategy to construct UI with Jetpack Compose
Threads is constructed on high of current code from its sister app Instagram, which makes use of Views for its UI growth. After optimistic studies from different Android builders about Compose, and following inner testing and an evaluation of the toolkit’s advantages, Threads engineers opted to construct the all-new app from scratch utilizing Compose. By utilizing Compose, the group might transfer quicker and higher put together the app for any future updates.
“We determined Jetpack Compose can be our goal UI framework going ahead,” mentioned Richard Zadorozny, a software program engineer at Threads. “We wished to construct the brand new app UI from scratch utilizing Compose as a result of it could allow us to maneuver quicker than refactoring a big software like Instagram.”
Although most of Threads’ engineers had no prior expertise utilizing Compose, they discovered it simple to get began and study the brand new toolkit. With Compose, Threads engineers constructed and shipped the app in solely 5 months. This enormously exceeded the group’s velocity expectations for creating a high-quality Android software — particularly of this complexity and scale. The group attributes a lot of this velocity to the flexibleness and decoupling Compose offered.
Compose helped Threads engineers streamline the event of recent product options. The modular nature of the toolkit let Threads builders iterate on the app because it developed and teed up the app’s structure for future growth. Compose additionally helped engineers construct user-friendly options that adhered to Materials Design pointers.
Going all in with Compose
Threads engineers developed nearly the entire app’s surfaces utilizing Compose. In the long run, they constructed over 90% of Threads utilizing Compose, together with the app’s exercise feed, navigation, search, profiles, onboarding web page, shared ingredient transitions, media viewer, settings, and extra.
Whereas Compose did principally every little thing Threads engineers wanted it to, it was nonetheless simple for them to interoperate with Views as crucial. They used Views for Threads’ movies and the media picker that’s obtainable when creating a brand new publish.
Compose gives trendy APIs that ship straight with an app. Due to this, Threads engineers spent much less time worrying about backward compatibility, lacking options, or differing performance between completely different variations of Android. As an alternative, they might focus their power on creating a high-quality software.
“Compose’s design encourages a modular, plug-in method to growth,” mentioned Richard. “Modifiers make all types of performance inherently reusable, so that you now not need to subclass sophisticated ViewGroups or lump all types of logic into one place.”
The Threads group used Modifiers for the app’s customized click on behaviors and its thread line illustration that seems on the left aspect of posts. Modifiers additionally allowed Threads builders to simply add the app’s branding to any components and ensured they have been correctly aligned on-screen.
Threads engineers additionally ensured the app was prepared for customers throughout platforms at launch. That meant ensuring Threads resizes to work on completely different gadgets, like massive screens and foldables. The adaptive layouts Compose affords guarantee an app responds correctly to completely different display sizes, orientations, and type elements. This made it simpler for the Threads app to “simply work” for configuration adjustments, in accordance with Richard.
Compose is the ‘future’ of Android UI
Compose supplied Threads builders a neater strategy to design and create UI whereas getting ready the app’s structure for the long run. With its intuitive composables and trendy declarative framework, Compose made end-to-end growth clean and gave Threads builders confidence that updating the app can be simple.
Given the optimistic outcomes the group noticed with the discharge of Threads, Meta plans to broaden its use of Compose to a few of Instagram’s most necessary surfaces, just like the app’s primary feed.
“It’s reached a degree the place Jetpack Compose can do nearly every little thing you’ll want, and its modular nature makes it simple to make a lot of the adjustments you would want to fill the gaps,” mentioned Richard. “I imagine Compose is the way forward for Android UI growth, and it’s simply enjoyable!”
Get began
Optimize your UI growth with Jetpack Compose.
[ad_2]