When a ProgressIndicator doesn't have a preferred width or height, its size will be calculated incorrectly as we rely on its super class, ProgressBar's onMeasure() method to decide its size. But ProgressBar doesn't support "unspecified" preferred width/height, in this case it will set measured dimensions to fixed values based on the incorrect "preferred size".
Fixes this issue by fallback to the default View.onMeasure() logic when no preferred width or height is specified.
Resolves https://github.com/material-components/material-components-android/issues/2163
PiperOrigin-RevId: 452795304
It actually affects both swiping and setting the state programmatically. Removes the description regarding swiping to make it more accurate.
PiperOrigin-RevId: 452684555
Move the unchecked and checked state calculation off from each invalidate() call to onCreateDrawableState() so we can make sure we will only calculate the states when needed.
PiperOrigin-RevId: 452092712
Replace the usage of deprecated setSystemUiVisibility() with WindowCompat.setDecorFitsSystemWindows(). The original implementation will override any existing system visibility flags, so this CL also fixes the issue that certain existing system visibility settings like light navigation bar is reset.
Resolves https://github.com/material-components/material-components-android/issues/2582
PiperOrigin-RevId: 452075757
Before this CL we always reset the state-list animator when FAB elevation changes, i.e., any state-list animators set via XML will be overridden because elevation is set later. Fixes this by storing the default state-list animator created in onElevationsChanged() and check if it's been overridden before we update and reset it.
Resolves https://github.com/material-components/material-components-android/issues/1218
PiperOrigin-RevId: 452073249
In the original implementation, we wrongly applied layout height on the bottom sheet dialog root view, instead of its content, which makes full-screen dialog broken since it's setting layout height to the content instead. Refactors the logic so the layout height will always be set to the content, instead of the root view.
PiperOrigin-RevId: 450932326
This CL fixes two issues regarding bottom sheet dialog status color adjustment in edge-to-edge mode:
1. Uses WindowInsetsControllerCompat to set status bar color to replace the deprecated way of setting flags, which cannot override the light/dark setting set by WindowInsetsControllerCompat.
2. Tracks Window change so the original status bar color can be updated when the dialog is re-shown. (The day/night mode can be changed when the dialog is hidden.)
Resolves https://github.com/material-components/material-components-android/issues/2168
PiperOrigin-RevId: 450463570
In CollapsingTextHelper we are checking both the expanded bound and the collapsed bound to be larger than 0 to decide if we are going to draw the collapsing text. However this can result in a situation that when there's no space to display expanded hint, the collapsed hint won't be drawn either, even if the hint is not expandable at all.
This CL fixes the issue in a more generic way - whenever draw() is called, we check if the current bound (should be calculated whenever the collapsing fraction is changed) is larger than 0 to decide if we need to draw the collapsing text.
This CL also adds the logic to ensure the cutout bound will never be larger than the collapsed bound.
Resolves https://github.com/material-components/material-components-android/issues/2573
PiperOrigin-RevId: 449597658