As the title suggests, i require 4 action buttons(one of which is "Cancel") in a material dialog but there is provision of only 3.Is there any way to adjust 4 buttons while following the google design guidelines.
Asked
Active
Viewed 1,752 times
1
-
You can add a list, for example: http://stackoverflow.com/a/15762955/4503373 – Luca Ziegler Nov 20 '15 at 13:32
-
1We don't cover this case explicitly in the Material spec, but it would be reasonable to follow the "Stacked full-width buttons" example from the [Dialogs](https://www.google.com/design/spec/components/dialogs.html#dialogs-specs) section. If you end up with many more than four actions, however, you might consider using a scrollable list. – alanv Nov 20 '15 at 14:49
1 Answers
3
According to material design only 3 buttons can be added. As you said, one of your buttons is "Cancel", then I would like to suggest you to do this :- Add three buttons on their respective places except the cancel one and use the setCanceledOnTouchOutside(boolean cancel) method to use the cancel functionality on the dialog. You can then use onCanceledListener to detect for the cancel event on your dialog.

Varun Kumar
- 1,241
- 1
- 9
- 18
-
That seems the only option.Btw how about a cross button("X") on top right corner of dialog – Arpit Khurana Nov 20 '15 at 15:19
-
You can have a ("X") button only with a full-screen dialog app bar. See the link :- https://www.google.co.in/design/spec/components/dialogs.html#dialogs-specs – Varun Kumar Nov 21 '15 at 03:04
-
The image which I want you to see is shown in the section titled "Full-screen dialog titles". On the right hand side of this title, the image is shown with a ("X") button. – Varun Kumar Nov 21 '15 at 03:05