[Alert Dialog] Padding added on bottom when the positive button's text is a little long
See original GitHub issueDescription: When creating a MaterialAlertDialog with the positive button’s text a little long, padding gets added to the bottom of the dialog making it look out of place.
Expected behavior: There should be no padding added.
Source code:
MaterialAlertDialogBuilder(requireContext()).apply {
setTitle("Dialog title")
setMessage("Dialog body")
setPositiveButton("Agree and continue") { _, _ ->
}
setNeutralButton("No") { _, _ ->
}
show()
}
Devices: OnePlus 6, Xiaomi Mi A2, Motorola G5 Plus Android API versions: OnePlus 6 - 29, Xiaomi Mi A2 - 28, Motorola G5 Plus - 27 Material Library version: 1.2.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Dialog buttons with long text not wrapping / squeezed out
Whenever there is long text on dialog buttons, that doesn't fit the button bar width in total, the text isn't wrapped in multiple...
Read more >[MaterialAlertDialog] Extra space below buttons if they fill the ...
Description: Whenever negative and positive buttons of a dialog are close to being stacked vertically, the MaterialAlertDialog adds some ...
Read more >AlertDialog ignores itself's default button padding, if button ...
If I add padding to my button's text content, the AlertDialog ignores it's default button containers bottom padding of 8.dp.
Read more >Dialogs - Material Design
Stacked buttons accommodate longer button text. Confirming actions appear above dismissive actions. Dialog with two full width text buttons, one above the other....
Read more >Using DialogFragment | CodePath Android Cliffnotes
DialogFragment is a specialized Fragment used when you want to display an overlay modal window within an activity that floats on top of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue can be replicated using an emulator with these specs: https://www.gsmarena.com/oneplus_6-9109.php
It doesn’t happen with the appcompat
AlertDialog.Builder
.Confirm this as a bug in appcompat lib. It’s been fixed in appcompat 1.4 and later. MDC 1.7.0-alpha02 has upgraded appcompat to 1.4. If you are using earlier versions, add/update appcompat to 1.4 in your build.gradle should fix it.