https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

09/09/2020, 7:10 PM
I haven't tried using compose for this, but early today I was tasked with implementing a Modal (dialog, alertDialog, fragmentDialog?) in regular android UI toolkit land and it just got me thinking... I really hate writing modals/dialogs currently in Android. The width of the modal is always an issue I have to work around, there's like 3+ dialogs to use/inherit from and I always forget what's the right one, and there's weird gotchas where you have to remember to override one method, but not another method. Maybe it's just me? What is compose doing to make modals easy in Android?
i

Ian Arbuckle

09/09/2020, 7:15 PM
Since Compose follows material design you should consider using bottom sheet dialogs for supplementary information. https://material.io/components/sheets-bottom#usage
c

Colton Idle

09/09/2020, 7:16 PM
Not to change the subject, but bottom sheets have an equally terrible API in my opinion. My team has had so many issues trying to get bottom sheets to work properly. In this case though, my designer definitely does not want a bottom sheet. They want a modal.
i

Ian Arbuckle

09/09/2020, 7:19 PM
I haven't seen any popup modal dialogs in Compose yet. There is
ModalDrawerLayout
and
BottomDrawerLayout
Actually there is
AlertDialog
you can try 🙂
2 Views