You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sure you're aware but you can create the center stacked dialog by either overriding your theme's materialAlertDialogTheme attribute to ThemeOverlay.MaterialComponents.MaterialAlertDialog.Centered or create one-off centered dialogs by passing in the theme overlay to MaterialAlertDialogBuilder's constructor.
I doubt we will make the theme use centered dialogs by default as it would be a large breaking visual change at this point, but I will bring it up and see what the team thinks.
Thanks @hunterstich! I wasn't aware and we'll use that. We were trying to work around it with a custom title view.
From the specs, I thought the centered icon was now the default. If default dialogs stay as they are, I think it'd be useful if you could update the specs to show the default dialog (or both styles!) to avoid confusion, but it's of course up to the team. I see the attribute is documented as "Centered theme overlay" but I wasn't able to work out that it'd put the icon above the title from that description. An image or a more detailed explanation would also help there.
Description: According to the specs (https://github.com/material-components/material-components-android/blob/master/docs/components/Dialog.md#anatomy-and-key-properties) when a dialog has an icon, it's at the top, above the title. However, when we set an icon in a dialog, we see the icon appear on the left of the title (in English).
Looking at the implementation (https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/dialog/res/layout/m3_alert_dialog_title.xml) the icon is in the title layout. It's the first component inside a linear layout with horizontal orientation (https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/dialog/res/values/styles.xml#L69), so the code puts it on the left (in LTR languages) of the title.
Expected behavior: The code and the specs match
Source code:
https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/dialog/res/layout/m3_alert_dialog_title.xml
https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/dialog/res/values/styles.xml#L69
Minimal sample app repro: N/A
Android API version: 30
Material Library version: 1.11.0
Device: Emulator
cc @eartle
The text was updated successfully, but these errors were encountered: