Search code examples
androidandroid-testingglance-appwidget

How to apply Android Code Search examples that use different source sets in Android Studio Project?


I am looking at the source code for Glance Widgets on Android Code Search. I would like to replicate the code used for CheckBoxTest.kt but running into an issue. The problem is the code uses a version of GlanceAppWidget.kt which differs from GlanceAppWidget used in the official api release.

How can I replicate CheckBoxTest.kt in Android Studio so that it works with the Glance API provided in the official release.

For context, I am following the answer in this post.


Solution

  • All the code merged in androidx libraries is deployed into SNAPSHOT versions of the library. See https://androidx.dev/

    That being said, there is code in the CheckBoxTest.kt that is only for testing so you would need to copy those classes.