Closed francescocervone closed 1 year ago
Hey @francescocervone, from the project you sent it seems that you have forgotten the dependency from :app
to :composables
. Furthermore, the composable module that has the previews that you want to show in the Showkase app needs to implement the showkase dependencies.
If you apply this diff. Then do a clean build and run the project again, you will see the button from your composable module.
diff --git a/app/build.gradle b/app/build.gradle
index 07a8313..e0e23de 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -36,6 +36,7 @@ android {
}
dependencies {
+ implementation project(':composables')
implementation platform('androidx.compose:compose-bom:2022.12.00')
implementation 'androidx.compose.material:material'
implementation 'androidx.compose.ui:ui'
diff --git a/composables/build.gradle b/composables/build.gradle
index fc4fcac..de16799 100644
--- a/composables/build.gradle
+++ b/composables/build.gradle
@@ -1,6 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
+ id 'org.jetbrains.kotlin.kapt'
}
android {
@@ -38,4 +39,7 @@ dependencies {
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-tooling-preview'
debugImplementation 'androidx.compose.ui:ui-tooling'
+
+ implementation "com.airbnb.android:showkase:1.0.0-beta15"
+ kapt "com.airbnb.android:showkase-processor:1.0.0-beta15"
}
\ No newline at end of file
You can consider using compileOnly
in the :composable
module if you don't want it to be exposed to dependent projects.
from the project you sent it seems that you have forgotten the dependency from :app to :composables
Oh what a shame, I forgot about that in the sample, but in our project I didn't.
I was actually missing that I needed to import Showkase also in the imported module. Thanks!
We have a
design-system
module. We'd like to create an Android application moduledesign-system-preview
that imports composables fromdesign-system
and shows the Showkase activity.By reading the documentation, I believe we just need to declare our
@ShowkaseRoot class MyRootModule : ShowkaseRootModule
in ourdesign-system-preview
, apply Showkase annotation processor and everything should work as expected.Unfortunately I found two issues:
getBrowserIntent
extension doesn't get generated. It gets generated if you have at least one@Composable @Preview
indesign-system-preview
getBrowserIntent
, the Showkase activity shows only composables defined indesign-system-preview
.I've created a sample project: https://github.com/francescocervone/ShowkaseMultiModuleBug