11 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
dsn5ft
3ce7c2bb18 [SearchBar] Update predictive back device corner logic to handle each corner independently to fix issue where bottom corners are incorrectly rounded after canceling back gesture
PiperOrigin-RevId: 677788624
2024-09-23 15:10:54 +00:00
dsn5ft
5559cbc7c7 [Predictive Back][Search] Update to use decelerate interpolator
PiperOrigin-RevId: 571442671
2023-10-10 10:20:11 -07: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
fb56ab4130 [Predictive Back] Make MaterialMainContainerBackHelper collapsedView optional
PiperOrigin-RevId: 536880239
2023-06-05 18:41:24 +00:00
dsn5ft
e69a324a2f [Predictive Back][Search] Fix issue on Android U where clicking SearchView back button causes SearchBar to disappear and back arrow animation to not run
PiperOrigin-RevId: 536876120
2023-06-05 18:25:48 +00:00
dsn5ft
a93c91a2e2 [Predictive Back][Search] Only use device corner radius if SearchView reaches edge of screen
PiperOrigin-RevId: 524283122
2023-04-17 12:17:13 -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
a4b6f46f0c [Predictive Back][Search] Update SearchView to support predictive back when set up with SearchBar
PiperOrigin-RevId: 520613990
2023-03-30 16:35:21 +00:00