We load maxWidth and maxInlineActionWidth style attributes in SnackbarContentLayout, but the snackbar styles are only applied to SnackbarLayout. We need to pass the values to SnackbarContentLayout, as we did for actionTextColorAlpha.
Resolves https://github.com/material-components/material-components-android/issues/781
PiperOrigin-RevId: 404320339
The box background of text fields are applied to EditTexts instead of the TextInputLayout. So when there are paddings in TextInputLayout, we will need to adjust cutout bounds, which is calculated based on TextInputLayout's coordinates, according to the paddings.
PiperOrigin-RevId: 404281248
Before, when swiping with TalkBack on, the placeholder text would be mistakenly announced. This change makes it so it's only announced when it appears, for API >= 16. It's still announced as part of the description announcement when the text field is selected, as before, so it's still accessible for APIs < 16.
PiperOrigin-RevId: 404266249
When a collapsed label is showing, we cutout part of the border of an outlined text input box according to the exact stroke width. However when using rounded corners, there can be slight offsets from where the border is really drawn. Also, if the corner size is large, the part of border we need to cutout might not just be a straight line but contains part of the corner.
However, with the existing cutout logic, we cannot just cutout the whole label area, which will cause the area inside the border also gets cutout, if it has color. This CL changes the cutout drawing logic to only apply the cutout on stroke drawing to fix the issue.
This CL also fixes the bug that when the label is too long, we didn't take the ellipsized text length into account. Creates a variable to store the calculated collapsed text width to fix the issue.
Resolves https://github.com/material-components/material-components-android/issues/2145
PiperOrigin-RevId: 402316057
In the snap logic we didn't take the AppBarLayout's top padding into account, therefore in certain cases the scrolling will be incorrectly snapped to the top of CollapsingToolbarLayout instead of the bottom of it, which cause the title not collapsed.
PiperOrigin-RevId: 400749401
With MaterialButton, if we want an icon to be center aligned when there's no text, we need to set icon padding to 0dp and icon gravity to text-start or text-end. Updates the M3 style to make the icon center aligned.
Resolves https://github.com/material-components/material-components-android/issues/2388
PiperOrigin-RevId: 400242967
When mapping colors from a perceptually accurate color space to RGB for display, we need to identify if the color clipped to RGB is close enough to the requested color, this change allows 1 part in 1 billion error.
PiperOrigin-RevId: 398195568
An app bar remembers the visible percentage of its first visible child during recreation to restore its scroll position. However, if an app bar is "fully" scrolled (scrolled to its maximum range), gets recreated, and changes its size after recreation, it can become not fully scrolled even if it keeps the same visible percentage of its first visible child, due to the difference in its own size. This can result in unexpected "gaps" in the layout due to inconsistency between AppBar layout's scroll position and the content view's.
Fixes this by remembering the "fully scrolled" state and restore it during recreation.
PiperOrigin-RevId: 398013525
1. When a new tab indicator drawable is set, we didn't correctly restore the previous set indicator height to the new drawable, or set the drawing bound to the intrinsic height of the drawable, if the indicator height was not specified. This result in a 0-height drawing bound after setting the tab indicator, which makes it disappear and can never go back if the tab indicator gravity is not "stretch" (which will recalculate the height after moving the indicator). Fixes this by correctly set the drawing bounds after a new tab indicator drawable is set.
2. After we set full-width flag of tab indicator, the width won't be updated until we move the tab indicator. Fixes this by explicitly triggering the recalculation of tab indicator's drawing bound after changing the flag.
Resolves: https://github.com/material-components/material-components-android/issues/2354
PiperOrigin-RevId: 397823617