Material-dialogs: Re-think max width

Created on 18 Mar 2019  路  12Comments  路  Source: afollestad/material-dialogs

Library Version:

2.1.0

Affected Device(s):

Google Pixel 2 XL with Android 9.0

Describe the Bug:

The dialog width changed (got smaller) when upgrading from 2.0.3 to 2.1.0.

Does this have a particular reason?
How can I change the width of the dialog, as the new width is a bit too small (for me)?

improvement

Most helpful comment

I've restored the previous max width values before they shrunk. Keeping the maxWidth() setter around as well.

All 12 comments

This is matching Google's newer spec

Is there a way to override this width to be more like 2.0.3? It is definitely too small for me too.

By the way, all your screenshots still reflect the larger widths :)

I'd also like to customize the width, especially for the datepicker, this width is too small.

I'd also like to customize the width, especially for the datepicker, this width is too small.

yes, there's quite a few scenarios where large margins are not suitable. also it doesn't look good.

@afollestad which spec btw looking@ https://material.io/design/components/dialogs.html# does not show such margins.

The specs show a width of 280dp

I have a lot of custom dialog scenarios where that width does not work. And I agree with @guger definitely not for datepicker. Is there any way to expose md_dialog_max_width so we can override?

I really appreciate your work on this library. One of the best!

Yes, but it may get a more complex than that - the value is different for values, values-land, values-sw600dp, etc.

It seems unideal to make consumers have to remember to have different values for different screen dimens.

You are correct, normal consumers should not have to remember different values, but power users should at least have the option to override?

No worries I'll stick with 2.0.3 :) Thanks again for your work!

thanks @afollestad

customization option is great.

inconsistency with spec is probably because your library can do much more than spec is designated for, so my suggestion would be custom size > spec width in case measured view is within bounds > previous version standard width which would neatly cover all use cases with minor consumer impact.

Agree, this library shouldn't strictly follow all the specs since some of them don't really make sense if applied over here.

Great work anyways :)

I agree there should be either a way to set a custom max width, or some changes done to the library ... It looked so much better before @afollestad 馃槙 馃槥

Here's a comparison from a picture in the Material Design specs and one from my app

| Material Design Specs | My App using v 2.6.0 |
|-----------------------|----------------------|
| mio-design_assets_1g8052ZKUjp4a9STlAHL9FJ7MtLTOHJnK_dialogs-alertdialog-do-1 | Screenshot_20190405-173437_Frames |

I've restored the previous max width values before they shrunk. Keeping the maxWidth() setter around as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  4Comments

jahirfiquitiva picture jahirfiquitiva  路  6Comments

imcloud picture imcloud  路  5Comments

azizimusa picture azizimusa  路  4Comments

ghost1372 picture ghost1372  路  5Comments