CMP 1.10 now supports the `androidx.Preview` annot...
# multiplatform
e
CMP 1.10 now supports the
androidx.Preview
annotation in common code, but
@PreviewLightDark
is not supported yet?
z
There was a bug with those built-in multipreviews not rendering, but should be fixed now afaik https://youtrack.jetbrains.com/issue/KMT-1781
Is this what you're seeing? And if so, what's your IDE version?
e
I am using this version
Copy code
Android Studio Panda 1 | 2025.3.1
This is what I see, if I'm trying to use
@PreviewLightDark
z
Oh yeah, I'm seeing the same 🤔 Thanks for the report, I'll look into what's up with the versioning here. But the fix is definitely on its way at least!
❤️ 1
👍 1
e
alright, thank you
z
The fix will be in the Panda 2 version of the plugin, but it hasn't shipped yet. There's a tracking issue for it: https://youtrack.jetbrains.com/issue/KMT-2206
🙏 3
kodee loving 1
j
For now you can just add both these to your preview:
Copy code
@Preview(name = "Light")
@Preview(name = "Dark", uiMode = AndroidUiModes.UI_MODE_NIGHT_YES or AndroidUiModes.UI_MODE_TYPE_NORMAL)
It’s the same thing the
@PreviewLightDark
does.
👍 1
e
@zsmb sorry to ping you again, but should these multi-previews be working now? I am on
Android Studio Panda 2 | 2025.3.2
but can't seem to get these working yet. Previews annotated with
@PreviewLightDark
are simply ignored in the preview window.
z
Panda 3 Canary 4 includes the fix for Android Studio, so that or any newer version should work
❤️ 1