For the More Curious: Accompanist

Jetpack Compose is stable, but still in its early days. For many apps, the Compose dependencies you used with Coda Pizza offer every component and API you need to build the UI of your dreams. For other apps, though, you might find that the Compose libraries do not quite have all the features you need.

Jetpack Compose version 1.1, for example, does not offer a built-in way to change the status bar or navigation bar colors, request permissions from a composable, or make your UI respond to display cutouts and notches, to name a few examples. But fear not: In addition to the mainstream Compose APIs, Google also offers a set of libraries to provide this functionality and more.

Accompanist is a constantly evolving set of libraries that offer functionality that is not yet built into the mainstream Compose dependencies. They offer a quick way for developers to access these features in their Compose apps. The goal for most Accompanist libraries is that they will eventually graduate out of Accompanist and into the official library they are part of.

For example, Accompanist previously included support for loading images with Coil in Compose, but that functionality has since been moved into Coil itself. Developing features this way allows the Compose team to more effectively design and experiment with these APIs.

Because of these evolutions, Accompanist leans toward being an experimental library. Regardless, we encourage you to take a look at Accompanist and see which of its features are useful for your app. These features are ready to go, and – despite the experimental designation – ready for use in production apps.

If you do choose to incorporate Accompanist, keep in mind that its APIs are likely to change over time. Features in Accompanist that make their way into the official Compose dependencies will eventually be removed, which will require you to make updates in your application.

It is too early to tell what the future of Compose looks like, but it looks like Accompanist will be a useful breeding ground for supporting a larger set of features within Compose. For more information on Accompanist, including its latest version and which features it can offer, see its official documentation at google.github.io/​accompanist.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.24.180