6 Commits

Author SHA1 Message Date
dsn5ft
11068909c2 [Predictive Back] Add safety checks for float != NaN
Resolves https://github.com/material-components/material-components-android/issues/4307

PiperOrigin-RevId: 678679393
2024-09-25 14:34:06 +00:00
afohrman
02dc77923b [Predictive Back] Fixed IllegalStateException crashes caused by MaterialBackAnimationHelper.
PiperOrigin-RevId: 555180647
2023-08-09 16:09:42 +00:00
afohrman
122c2966fd [Predictive Back] Fixed possible NaN crashes in MaterialBottomContainerBackHelper, MaterialMainContainerBackHelper and MaterialSideContainerBackHelper.
There were some cases where we were dividing by the view's width and height in the  updateBackProgress methods, and this would cause a division by 0 exception and crash in cases where either the width or height are 0. Added a bunch of safeguards for division cases where the denominator could be 0.

PiperOrigin-RevId: 541929872
2023-06-26 21:25:39 +00:00
hunterstich
a67a885668 [Predictive Back] Update components to use BackEventCompat
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
2023-06-14 12:44:53 -07:00
dsn5ft
69b5386e4b [Predictive Back] Make back helpers support generified View type
PiperOrigin-RevId: 523442268
2023-04-13 09:03:37 -07:00
dsn5ft
d6fad952c6 [Predictive Back][Bottom Sheet] Update Bottom Sheet to support predictive back
- Enable predictive back by default for Bottom Sheet dialogs
- Update Catalog demo to enable predictive back for persistent/standard bottom sheet

PiperOrigin-RevId: 518896205
2023-03-23 18:15:27 +00:00