10 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
pubiqq
510881a469 [Internal] Stop using deprecated androidx.core.view.* methods
Resolves https://github.com/material-components/material-components-android/pull/4117

GIT_ORIGIN_REV_ID=dd157e8360c2511810496693cec1616fce578655
PiperOrigin-RevId: 632284856
2024-05-13 17:37:38 +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
52f1737dd8 [Predictive Back][Side Sheets] Fix subtle detached side sheet glitch where after predictive back the sheet does not fully slide off screen
PiperOrigin-RevId: 527577382
2023-04-27 16:37:18 -04:00
dsn5ft
9405121f62 [Predictive Back] Update side container back helper to support containers with arbitrary child views
PiperOrigin-RevId: 525466973
2023-04-19 14:12:04 -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
dsn5ft
2c297faf4b [Predictive Back][Navigation Drawer] Infrastructure for back handling in components + Navigation Drawer predictive back support
- Added MaterialBackHandler interface and MaterialBackOrchestrator class
- Implemented animations in MaterialSideContainerBackHelper for NavigationView when DrawerLayout parent

PiperOrigin-RevId: 517399606
2023-03-20 21:10:22 +00:00