In the Kdoc documentation there are numerous `@sample` references ```* @sample androidx.compose.mate...
s
In the Kdoc documentation there are numerous
@sample
references
Copy code
* @sample androidx.compose.material.samples.CardSample
But they are not working for me and I can't see the samples. Is there a dependency that I'm missing? There was nothing in the google maven
j
The samples are hosted in a separate module that isn't published AFAIK, so you can't depend on it and can't resolve it The samples are all browsable through cs.android.com, just search for the sample's name there
🙏 1
Here's a feature request I filed a bit back: https://issuetracker.google.com/issues/181142265 The team said they'd look into it
🙏 1
1
a
Btw you can see them on the API pages of developer.android.com.
c
@jossiwolf I can typically find samples on cs.android.com but do you have any tricks in terms of what packages to look into specifically? Like I searched for an AndroidView sample but get a bunch of results and like. Any pro tips to get faster at spotting the right result?
j
@Colton Idle Generally, the sample file naming follows the schema
{ComponentName}{Sample}
and that gets you to most places (e.g. AndroidViewSamples gives you the sample as the first result 🙂). But yeah, some searches can be a bit harder... in these cases I usually try to search for
@Composable fun {ComponentName}
and look for the sample from there :)
Apart from that - I have set up the AndroidX repo locally where I can run an Android Studio instance that has all the source and that makes experimenting and jumping through all the implementation a lot easier🙂 You have to use Repo, but after a while you'll get used to it and you can keep the usage minimal. See https://android.googlesource.com/platform/frameworks/support/+/androidx-main/README.md and I'm happy to answer any questions!
👍 1
Going to the Jetpack repo on cs.android.com should also help narrow down the search results! You can get there from cs.android.com -> AndroidX -> platform/frameworks/support
👍 1
c
Thank you!