Skip to content

[MaterialAlertDialogBuilder] Vertical background insets are too large when soft keybard is shown #3418

@mtotschnig

Description

@mtotschnig

MaterialAlertDialogBuilder defines a bigger vertical margin for dialogs via attributes backgroundInsetTop and backgroundInsetBottom
The default is defined via dimens mtrl_alert_dialog_background_inset_top and mtrl_alert_dialog_background_inset_bottom to be 80dp on normal screens with portrait orientation. This is generally fine, but gives an unfortunate result when the soft keyboard is shown and reduces the dialog height.
Compare the appcompat builder with the material builder with the keyboard hidden:
Screenshot_1684693459
Screenshot_1684693484
and the keyboard shown:
Screenshot_1684693432
Screenshot_1684693365

While the appcompat dialog is perfectly usable, the material dialog is too small, and makes the dialog difficult to use, in the case of this example hiding too much of the content from the user.

I do not know if this can be achieved by using configuration qualifiers, but ideally the vertical inset should react to the available window height taking the presence of the soft keyboard into account.

Material Library version: 1.9.0 and 1.10.0-alpha03

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions