https://kotlinlang.org logo
#compose-wear
Title
# compose-wear
a

Andrew Leung

11/24/2021, 9:30 PM
Hello, is the AlertDialog usable in Compose Wear? If not, what would be an alternative component to use for similar interactions?
For example, a screen that can take up the whole space, show some description text, a confirm button, dismiss button, and even better, can be swipe to dismissed
a

Alex Vanyo

11/24/2021, 10:26 PM
These are in-progress, and will be in the wear compose-material library here: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:wear/com[…]rc/commonMain/kotlin/androidx/wear/compose/material/Dialog.kt They haven’t been released as part of an alpha yet, but if you’re feeling adventurous, you can try them out with a snapshot build which uses the latest tip-of-tree code: https://androidx.dev/
👍🏻 1
a

Andrew Leung

11/25/2021, 1:13 AM
thanks for the reference!
👍 1
j

John Nichol

11/25/2021, 9:55 AM
you can get access to the latest snapshot release or they will be available next week in the alpha12 release
s

Steve Bower [G]

11/26/2021, 4:53 PM
There are two styles of dialog in this release - AlertDialog which is along the lines that Andrew described above, supports icon/title/message and either positive/negative Buttons or a stack of Chips. AlertDialog is also swipe dismissable. ConfirmationDialog is for simple acknowledgements - shows icon + title and self-dismisses after a timeout.
👍 1