- Published on
🚀 All about Google Accompanist
- Alex Styl
Happy Thursday! Alex here 👋
It is this time of the week. Time to get smarter in Jetpack Compose!
Did you know Google has a Jetpack Compose test lab? It's the place where they cook all new Jetpack Compose APIs!
The test lab I am talking about is called Accompanist and this is what we're going to be talking about today.
Before we jump into it, I got a new Jetpack Compose freebie for you!
Introducing the Jetpack Compose Components list on Composables
tl;dr I got fed up spending too much time trying to figure out if a component I want to use is available on Material 2 & 3.
Because of this I ended up building a list with all components available in Material 2 & 3 compose.
It contains details such as a photo of the component, available overloads and code samples for each.
Check it out at composables.co/components.
Okay, back to Accompanist now 👇
What is Google Accompanist?
Accompanist is a set of Jetpack Compose libraries maintained by Google. Google introduces new libraries into Accompanist when they want to try out new APIs and get developer feedback.
Eventually when the API matures enough, the library might end up in the official Jetpack Compose dependency and is then removed from Accompanist.
Google Accompanist is an open source project hosted on Github. You are more than welcome to have a look at the source code, file new issues and even contribute.
Why does Accompanist exist?
API design, as any other kind of design, is really hard to get right. It takes many design iterations: it involves a lot of back and forth with users of the API, collecting their feedback, asking them questions and talking about their experiences with other APIs, implementing changes and so on.
At a reach such as Google, the Jetpack Compose team needs to be extra careful introducing new APIs. Otherwise we (both Google and us, developers) might get stuck with APIs that are hard to use or might not make sense (Android devs, remember showing and hiding the keyboard with Android Views?).
With that in mind, Accompanist works as a great space to receive developer feedback and the community actively help out shape the future of Jetpack Compose.
If you can't find a way to do something using a standard Jetpack Compose API, it might already exist in Accompanist.
What is included in Accompanist?
As the time of writing the following modules are available:
- System UI Controller
- AppCompat Theme
- AppCompat Theme Adapter
- Material Theme Adapter
- Material 3 Theme Adapter
- Core Theme Adapter
- Pager layouts
- Swipe Refresh
- Drawable Painter
- Flow layouts
- Navigation Animation
- Navigation Material
- Test Harness
Out of all these I find myself using System UI Controller, Pager and Permissions in most of my apps.
What happens when an Accompanist API matures?
When an API is ready to be moved to Jetpack Compose, it will be marked as deprecated in Accompanist. The Insets module for example is an API that made its way to
If you are using the Accompanist Insets module, you can find a migration guide for an easy migration to the foundation API.
Would I need to migrate to the non-Accompanist API if the Accompanist version gets deprecated?
An API marked as
@Deprecated means that it is still functional but it won't receive any updates anymore. You can still use the deprecated API as long as you like.
There is a chance that the non-Accompanist version might receive an update (such as a new feature or a behavior change) that you will want to integrate in your app.
Until then there is not much need to replace the Accompanist version with the non-Accompanist version.
As a reminder, your app won't get any better to your customer's eyes by swapping out libraries or rewriting any code. Because of this, you might want to be move to a non-deprecated API when it takes sense to the business instead.
Horologist: Accompanist but for Wear
Horologist is to Wear OS what Accompanist is to Jetpack Compose. It provides a set of libraries dedicated to Wear OS.
Currently you can find the following modules:
- Compose Layout
- Data Layer
- Network Awareness
Accompanist is the place where new Jetpack Compose APIs are born. It is the place where Google releases their new APIs and collect developer feedback before adding new APIs in Jetpack Compose. It contains functionality not yet available in Jetpack Compose such as WebView, permission handling and pager layouts. A Wear OS version exists called Horologist. It contains functionality not available in Jetpack Compose Wear.
📰 Just in: Jetpack Compose 1.4.1 is now available
We just had quite a few Jetpack Compose libraries updates a few hours ago.
Here are the updates we got:
- 🎬 Compose Animation 1.4.1
- 🎬 Compose Animation 1.5.0-alpha02
- 🧱 Compose Foundation 1.4.1
- 🧱 Compose Foundation 1.5.0-alpha02
- 🎭 Compose Material 1.4.1
- 🎨 Compose Material 1.5.0-alpha02
- 🎨 Compose Material 3 1.1.0-beta02
- 🚀 Compose UI 1.4.1
- 🚀 Compose UI 1.5.0-alpha02
- 🏃♂️ Compose Runtime 1.4.1
- 🏃♂️ Compose Runtime 1.5.0-alpha02
- ⌚️ Wear Compose 1.2.0-alpha08
- ⌚️ Wear Compose 1.0.0-alpha02
That's all for today. Until the next one,