material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

Customise spacing between action buttons in DatePicker

Open ashishg656 opened this issue 1 year ago • 1 comments

Description: I want to customize the spacing between the action buttons (OK and Cancel buttons) and the dates in material3 date picker, but unable to do so.

Spacing between the action buttons (OK and Cancel buttons) and the dates is too high - how to reduce the spacing between the last row of dates and the action buttons.

In the screenshot, observe that spacing in left screenshot in much higher, whereas its smaller in the right screenshot.

Screenshot 2024-10-10 at 5 26 59 PM

Expected behavior: Spacing between action buttons & dates should be customizable.

Android API version: Android 21

Material Library version: 1.8.0

Device: Pixel 8 Pro & other android devices

ashishg656 avatar Oct 15 '24 12:10 ashishg656

Same issue here. For a simple dialog with a single line of text there is way too much of a gap between message and action buttons.

I could reduced the spacing a bit using:

    <dimen name="m3_alert_dialog_action_top_padding" tools:override="true">0dp</dimen>

Original spacing:

Image

Reduced spacing:

Image

That's still much spacing but tolerable I guess.

Things could be improved further if we could override the minHeight from contentPanel in m3_alert_dialog.xml which is currently hardcoded to 48dp.

Slion avatar Nov 30 '25 10:11 Slion