[MaterialAlertDialog] Extra space below buttons if they fill the whole width
See original GitHub issueDescription: Whenever negative and positive buttons of a dialog are close to being stacked vertically, the MaterialAlertDialog
adds some extra space below them:
This happens with the following patch applied to the codebase:
Index: material-theme-builder/src/main/java/io/material/materialthemebuilder/ui/component/ComponentViewHolder.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- material-theme-builder/src/main/java/io/material/materialthemebuilder/ui/component/ComponentViewHolder.kt (revision b58d3481c3619ca1e944f8c69e53418383489d2e)
+++ material-theme-builder/src/main/java/io/material/materialthemebuilder/ui/component/ComponentViewHolder.kt (date 1573147313000)
@@ -159,8 +159,8 @@
MaterialAlertDialogBuilder(view.context)
.setTitle(R.string.text_headline_6)
.setMessage(R.string.lorem_ipsum)
- .setPositiveButton(R.string.text_button, null)
- .setNegativeButton(R.string.text_button, null)
+ .setPositiveButton("longer button here", null)
+ .setNegativeButton("button", null)
.show()
}
}
Expected behavior: There should be no extra space below the buttons.
Android API version: 28
Material Library version: 1.1.0-beta01
Device: Nexus 4 Emulator
All OS settings are default including the font size.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:14
- Comments:12 (1 by maintainers)
Top Results From Across the Web
android - How to make an alert dialog fill 90% of screen size?
This answer was very helpful for the scenario of trying to recreate a dialog in onCreate after device rotation. In this case, we...
Read more >Dialogs - Android Developers
A dialog is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill...
Read more >Dialogs - Material Design
When there are three or more actions with long text labels in a Material dialog, ... Dialog with two full width text buttons,...
Read more >How To Set Margin For Buttons Materialalertdialog In Android
Ask questions[MaterialAlertDialog ] Extra space below buttons if they fill the whole width. Description: Whenever negative and positive buttons of a dialog are....
Read more >Android Material Components - MaterialAlertDialog
If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the...
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
better simpler.
I’ll close the issue since it’s been fixed on AppCompat. : )