avast / android-styled-dialogs

Backport of Material dialogs with easy-to-use API based on DialogFragment
Apache License 2.0
2.15k stars 450 forks source link

Can I add a button to a ProgressDialogFragment? #94

Closed ayerkovich closed 9 years ago

ayerkovich commented 9 years ago

I need to provide the user with a way of cancelling a running task. How can I do that? Thanks.

TomasKypta commented 9 years ago

Hi, styled dialogs can be greatly customized. You can see an example in the demo in JayneHatDialogFragment. To create progress dialog with a button you can either use SimpleDialogFragment where you add a view containing progress bar in setView. Or better you can extend ProgressDialogFragment and adjust its build(Builder) method (take your inspiration from SimpleDialogFragment).