Before 1.12.0-alpha01 which was released on 6/7, BuildCompat#isAtLeastU() only returns true if API level is greater than 33 and the version running is a pre-release. Two things happened on 6/7 -- the version became a "platform stable" version, and core library version 1.12.0-alpha01 was released, which changes BuildCompat#isAtLeastU() to return true if the version is 34 and stable.
PiperOrigin-RevId: 540304068
Clients should prefer listening to back events using androidx.activity.OnBackPressedCallback which has been updated to forward BackEventCompat objects in androidx.activity:activity:1.8.0-alpha05. This updates component predictive back APIs to take in BackEventCompat objects instead of android.window.BackEvent objects to simplify usage - getting rid of the need for version checks and object conversions.
PiperOrigin-RevId: 540290323
The close affordance icon and title text were previously aligned by the top. Since the icon button has extra spacing from insets and padding, the Views appeared to be misaligned. Aligning along the baseline fixes the visual misalignment.
This change is in the catalog since the side sheet view is provided by the developer.
PiperOrigin-RevId: 538570382
The LinearLayouts each contained only one child, so a FrameLayout is a better choice; more lightweight and slightly more performant. This is a visual no-op.
PiperOrigin-RevId: 532823326
This change is in the Catalog, since the developer is responsible for layout elements within the side sheet.
Also changed some other elements of the side sheet content layouts to balance out the visual look of the sheets.
PiperOrigin-RevId: 532788247
Before this change, the modal sheet is initially expanded with a "%f" for the slide offset text and the state TextView doesn't change until the first drag of the sheet.
There was actually no underlying side sheet bug here; the modal sheet has two ways of animating, window animations and the "native" SideSheetBehavior ViewDragHelper animations. In the catalog, the modal sheet's text views weren't getting set yet because it was using the window animations to enter/exit and the callback doesn't run until it's dragged with SideSheetBehavior's ViewDragHelper. The only change necessary here is to set the TextViews to Visibility#GONE until the callback runs, so that there are no uninitialized TextViews visible on screen.
Resolves https://github.com/material-components/material-components-android/issues/3167.
PiperOrigin-RevId: 529220073
Added an AnimatorUpdateListener that runs in finishBackProgress() to make the coplanar sibling's margins update as the sheet slides back to its origin edge.
PiperOrigin-RevId: 527749916
Sheet gravity is intended to be set once at setup before the sheet is shown; sheet gravity changes are not supported at runtime and will cause an IllegalStateException.
Also refactored modal sheet demo to recreate the sheet every time it's shown, which allows the sheet gravity changes to take effect for modal sheets.
PiperOrigin-RevId: 526957847
This changes the way arrangements are found by:
* Finding all possible arrangements of items
* Sort the arrangement candidates using a cost function that optimizes for total space fit, large item size retention, and adherence to other input params
* Fit and use the top arrangement to work within the carousel's available space
PiperOrigin-RevId: 522568015
It wasn't an issue for modal bottom sheets because they dismiss the whole window when the bottom sheet behavior is hidden
Also updated Bottom App Bar demo drawer to opt into predictive back, which is a standard hideable bottom sheet
PiperOrigin-RevId: 520312905