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
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
In the Chip implementation, onCheckedChangeListener was called before onCheckedChangeListenerInternal. This causes an issue that in onCheckedChangeListener's callback, the checkable group's checked state is not updated yet, therefore ChipGroup.getCheckedChipIds() will return the outdated checked state.
Fixes this by overriding Chip.setOnCheckedChangeListener to get full control of the execution order between onCheckedChangeListener and onCheckedChangeListenerInternal.
Resolves https://github.com/material-components/material-components-android/issues/2691
PiperOrigin-RevId: 449100861
Note that there are a slight behavior changes - when a new end icon mode is set, the state will always be reset, if applicable. This should be logically more consistent and correct than the current behavior.
PiperOrigin-RevId: 449027939
Adding the a11y delegate and a11y actions was dependent on there being a CoordinatorLayout child that both inherits from certain scrolling classes (NestedScrollingChild, ListView, ScrollView) and has an AppBarLayout scrolling behavior. This was too restrictive and so we only check for a behavior.
Any scrolling child may add an a11y delegate or scroll action to the parent CoordinatorLayout.
PiperOrigin-RevId: 448335380