Skip to content

Instantly share code, notes, and snippets.

@arriolac
Last active October 10, 2023 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arriolac/eb9c4399f8b63b08329fc76a7ddfb36e to your computer and use it in GitHub Desktop.
Save arriolac/eb9c4399f8b63b08329fc76a7ddfb36e to your computer and use it in GitHub Desktop.
Benefits of adding explicit support for Compose for your View-based library
Benefit Summary
Improve the developer experience Allow your consumers to take advantage of the benefits of Compose by providing an intuitive and declarative API for integrating your library.
Reduce boilerplate code Reduce the code your consumers have to write when using your library. Instead of having to use interoperability APIs, your consumers can directly use a declarative API through composable functions you provide.
Fewer bugs It can be challenging to switch between Compose's declarative style of thinking and View's imperative style of thinking. As a result, when consumers write interoperability code to interact with your View-based library, they can easily introduce bugs. Adding support for Compose guarantees correct interoperability, as this is not the responsibility of the consumer anymore.
Future-proof Compose is the modern recommended UI framework for building Android apps. By supporting Compose, you are preparing your library for a Compose-first future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment