Hi all :android-wave: , For Compose Previews, shou...
# compose-android
a
Hi all 👋 , For Compose Previews, should they be added to the
main
source set or the
debug
source set? Pros and Cons I could see:
main
Pros - Can preview any composable (
public, internal and private
) Cons - Preview methods are included in the final source code, which is not required.
debug
Pros - Preview methods are NOT included in the final source code. Cons - Can not preview
private
Composables as they are inaccessible from
debug
source set. I am referring to methods that contain code only for preview purposes. E.g.
Copy code
@Preview
@Compose
fun GreetingPreview() {
  Greeting("Hello Compose!")
}
solved 1
s
Option 3: Use R8 to remove unused code from the app binary
☝🏻 1
a
Hi @shikasd, So, the recommendation is to add the composable previews to the
main
source set and rely on R8 to remove it from the release APK?
s
yep 👍
👌 1
a
thank you color