This content originally appeared on DEV Community and was authored by Anton Shilov
Problem
While writing apps with Jetpack Compose you can always Cmd+Click
on a library function to check their sources and comments. And often you can find a link to the sample code with an example of usages for that function. Unfortunately, sample code is not published together with the Jetpack Compose library so you cannot browse them.
Easy Solution
All Jetpack Compose sources are open and published as a part of the AndroidX repo. We can quickly find sample code using Android Code Search website.
- Copy sample name from the sources
- Open https://cs.android.com in the browser
- Search for the sample code
Better solution
Keeping a browser tab open and manually copying function name is quite a hassle. We can do better, we can automate it! And CodeSearch plugin can help us with that. It allows us to launch search queries right from the IDE, and we can add a custom search engine.
- Install Code Search plugin https://plugins.jetbrains.com/plugin/12578-codesearch
Add Android Code Search engine to plugin settings(IDE restart required).
Name: Android CS
Url: https://cs.android.com/search?q=lang:kotlin usage:
Hope you found this post useful ?. You can follow me to get the latest news about Compose.
This content originally appeared on DEV Community and was authored by Anton Shilov
Anton Shilov | Sciencx (2021-07-01T10:09:54+00:00) Browsing Jetpack Compose samples. Retrieved from https://www.scien.cx/2021/07/01/browsing-jetpack-compose-samples/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.