Why not use Popup to implement Material AlertDialo...
# compose-desktop
k
Why not use Popup to implement Material AlertDialog?
k
Who is this question for?
k
For official team😄
k
This probably needs a bit more detail. What is not good with the current implementation? Why does it need a different one?
k
Well, simply speaking, it does not match Material Design. According to Material Design guidance, AlertDialog will pop up from current window, with a scaling-animation, and there will be a half-transparent layer behind it, called Scrim. The current AlertDialog will implement correct effect on Android. But on Desktop, that directly opens a new window, with a Card in it. And I found that
AlertDialog
belongs to
androidx.compose.material
package, while
Dialog
belongs to
androidx.compose.ui.window
package. So, is the so-called
Dialog
a material component? They cause confusions. Their concepts should be more clear.
s
I tend to think that the official needs to do more other more important things and no one note it.May report it as an issue? Dialog is drsktop specific api which experminal, seem need more time to modify.
👍 1
j
@Konyaco I'm not saying you're wrong, but we've been having some related conversations internally. Can you point me to the docs which describe that guidance/specification?
k
Material spec for dialogs talks about the scrim in https://material.io/components/dialogs#anatomy
j
Yeah, but in the section right above that talks about "Cross-platform adaptations" and specifically about using the platform's native alert functionality in material apps.
k
Right, I don't think that a desktop app should "invent" its own ways where there are established patterns on specific platforms (Windows, macOS, etc). There's also the distinction between Material as a design language and not necessarily the design language for Compose. So might as well end up with a generic desktop dialog in
ui.window
and some sort of a more opinionated dialog in
material
.
👍 2
k
In my humble opinion, "Cross-Platform adaptations" is a UX design, maybe we can provide some component like PlatformDialog, that provides different experience in different platform, but Material Dialog (related to UI Design) should always provide consistent behavior cross platforms.🤔