1.57.0
Fix AGP 9.0 KMP preview screenshots
We had been using unitTestSources?.**java**?.addGeneratedSourceDirectory, but this approach proved ineffective when we adopted com.android.kotlin.multiplatform.library. Consequently, we migrated to unitTestSources?.**kotlin**?.addGeneratedSourceDirectory for the KMP plugin. Unfortunately, when applying com.android.library, unitTestSources?.kotlin remains non-functional, so we must toggle between the two depending on the plugin.
Thank you for reporting this @HLCaptain !
(This is our plugin code, you don't have to write this.)
val isKmpLibrary = project.plugins.hasPlugin("com.android.kotlin.multiplatform.library")
if (isKmpLibrary) {
unitTestSources?.kotlin?.addGeneratedSourceDirectory(
generateTestsTask,
GenerateComposePreviewRobolectricTestsTask::outputDir
)
} else {
unitTestSources?.java?.addGeneratedSourceDirectory(
generateTestsTask,
GenerateComposePreviewRobolectricTestsTask::outputDir
)
}
Bugfix: Compose Preview’s onSizeChanged{} wasn’t called when multiple windows exist.
There is a bug in which Compose Preview’s fails to fire when multiple windows are present. This issue arises because we neglected to invoke