39 Commits

Author SHA1 Message Date
pekingme
8204856dd4 [Token][Color] Upgraded to v0.170 for tonal surface colors.
PiperOrigin-RevId: 555230534
2023-08-09 19:03:25 +00:00
rightnao
e3b255b3a0 [Docs] Crosslink github docs in javadocs
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
afohrman
f2e70d2d66 [Android U] Replaced BuildCompat#isAtLeastU() method calls with explicit SDK checks for UPSIDE_DOWN_CAKE.
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
2023-06-14 12:45:51 -07: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
afohrman
ad9ad204f8 [Side Sheet] Renamed private references of "origin" to "inner" in SheetDelegate and related delegate classes.
PiperOrigin-RevId: 529193878
2023-05-04 07:40:36 -07:00
afohrman
5ba704a273 [Predictive Back] [Side Sheet] Added updateBackProgress() predictive back support for coplanar side sheets.
Before this change, coplanar sheets responded to the sheet during finishBackProgress(), in handleBackInvoked(). After this change, coplanar sheets respond to the back progress while the predictive back event is in progress, in updateBackProgress().

PiperOrigin-RevId: 528470353
2023-05-01 10:53:53 -04:00
afohrman
b984e64445 [Predictive Back] [Side Sheet] Added handleBackInvoked() predictive back support for coplanar side sheets.
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
2023-04-28 14:46:43 -04:00
afohrman
8ae8a3791a [Side Sheet] Fixed side sheet swipe calculations in RightSheetDelegate.
These changes fix a bug for coplanar predictive back, where a sheet hide was triggered every time a predictive back swipe was started on a right coplanar sheet, rather than allowing the predictive back swipe.

PiperOrigin-RevId: 527681485
2023-04-28 14:45:04 -04:00
afohrman
f335a50907 [Predictive Back][Side Sheet] Added predictive back support for modal side sheets.
PiperOrigin-RevId: 527334991
2023-04-26 16:21:39 -04:00
afohrman
562285e051 [Predictive Back][Side Sheet] Added predictive back support for standard side sheets.
PiperOrigin-RevId: 527326750
2023-04-26 16:20:46 -04:00
afohrman
d0ad45e1a1 [Side Sheet] Added left/start modal sheet.
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
2023-04-25 17:07:13 -04:00
pekingme
a4c65d86d3 [SideSheet] Fixed container color assigned to incorrect attribute.
Should be `app:backgroundTint` not `android:background`.

PiperOrigin-RevId: 523147016
2023-04-11 19:59:04 -07:00
pekingme
5e427da912 [SideSheet] Removed the hasValue check for shapeAppearance to guarantee it always has a user value or default value to avoid NPE.
Resolves https://github.com/material-components/material-components-android/issues/3322

PiperOrigin-RevId: 522114031
2023-04-10 14:52:51 +00:00
afohrman
78fa15748f [Side Sheet] Added LeftSheetDelegate and left sheet support for standard and coplanar side sheets.
Standard and coplanar side sheets now support sliding and dragging from the left side, as well as automatic RTL mirroring when `layout_gravity` is set to `start` or `end`. Change the sheet edge by setting `layout_gravity` on the side sheet view in XML or programmatically.

PiperOrigin-RevId: 518048965
2023-03-20 21:25:55 +00:00
pekingme
9f1caa2c64 [Tokens] Upgraded to v0.162.
PiperOrigin-RevId: 517446114
2023-03-20 21:23:07 +00:00
pekingme
23dc14ca3a [Tokens] Updated to v0.157.
PiperOrigin-RevId: 505978081
2023-01-31 20:01:13 +00:00
afohrman
8e12e31c9a [Adaptive][Side Sheet] Renamed references to "outwards" to "outer".
"Outer" is clearer than "outwards".

PiperOrigin-RevId: 499904971
2023-01-05 12:59:26 -05:00
afohrman
e88e341699 [Adaptive][Side Sheet] Renamed private calculateSlideOffsetBasedOnOutwardEdge method to calculateSlideOffset in SheetDelegate and RightSheetDelegate.
The slide offset isn't actually based on the outer edge; changing the outer edge wouldn't change the slide offset calculation.

PiperOrigin-RevId: 499877224
2023-01-05 12:58:03 -05:00
afohrman
3b61327513 [Adaptive][Side Sheet] Added accessibilityPaneTitle to side sheet.
This adds an accessibilityPaneTitle that is spoken by TalkBack on API levels 19 and later.

In order to trigger the accessibilityPaneTitle event, it was necessary to add a visibility change when the sheet is expanded and hidden. The sheet now is INVISIBLE at STATE_HIDDEN and VISIBLE at all other states.

Also removed the code to switch focus to the sheet on expansion in favor of this approach to align with TalkBack's APIs.

PiperOrigin-RevId: 499604691
2023-01-05 12:57:15 -05:00
pekingme
e7d757a5da [SideSheet] Integrated tokens.
PiperOrigin-RevId: 497126105
2022-12-22 23:47:09 +00:00
afohrman
af16b051af [Adaptive][Side Sheet] Removed unused methods in SheetDialog and SideSheetDialog.
Also remove the redundant call to supportRequestWindowFeature in SideSheetDialog's constructor.

PiperOrigin-RevId: 495715894
2022-12-16 00:58:14 +00:00
afohrman
ad3cf5ad6b [Adaptive][Side Sheet] Add detached variant of modal side sheet.
PiperOrigin-RevId: 495709828
2022-12-16 00:57:15 +00:00
afohrman
938105a93b [Adaptive] [Side Sheet] Added detached variants of standard and coplanar sheets.
Added logic for an innerMargin to SideSheetBehavior and delegates and incorporated innerMargin into the sheet offset calculations to account for the extra spacing and avoid a jump when dragging the sheet to STATE_EXPANDED.

Also added a colored background to the catalog demo in order to see the corners of the sheet.

PiperOrigin-RevId: 495701453
2022-12-16 00:56:31 +00:00
afohrman
2fd2d66b43 [Adaptive][Side Sheet] Fixed issue where sheet would jump to the far edge of the screen in RTL without temporary fix.
PiperOrigin-RevId: 495687169
2022-12-16 00:55:39 +00:00
afohrman
bc61d6db62 [Adaptive][Side Sheet] Added coplanar side sheet with APIs for setting a coplanar sibling view.
PiperOrigin-RevId: 493959543
2022-12-08 20:03:52 +00:00
afohrman
48a3a758fa [Adaptive][Side Sheet] Set accessibility focus to the side sheet when expanded.
PiperOrigin-RevId: 493938007
2022-12-08 19:51:47 +00:00
dsn5ft
401527f9e7 [Side Sheet] Fix vertically scrolling sheet swipe issue by deleting most of the nested scrolling code
We shouldn't need nested scrolling in side sheet because the scroll and swipe directions are different, and horizontal nested scrolling doesn't seem supported

PiperOrigin-RevId: 493756832
2022-12-08 02:17:10 +00:00
afohrman
d481dddefd [Adaptive] [Side Sheet] Cancel modal side sheet scrim on STATE_HIDDEN.
PiperOrigin-RevId: 493655992
2022-12-07 14:51:53 -05:00
afohrman
c64f57224b [Adaptive] [Side Sheet] Restrict SheetDialog methods from the public API surface and rename getDismissWithAnimation.
PiperOrigin-RevId: 493644328
2022-12-07 14:51:08 -05:00
afohrman
2468d6cae6 [Adaptive] [Side Sheets] Add SideSheetCallback listener to SideSheetBehavior to track @SheetState state change events.
Includes a fix for a really strange issue where setting the background color from the callback worked, but if setText was called, it would cause the sheet to flash off the screen when STATE_EXPANDED was reached.

PiperOrigin-RevId: 493409073
2022-12-07 14:48:36 -05:00
afohrman
2ab5430fed [Adaptive] [Side Sheet] Renamed SheetEdge#RIGHT to SheetEdge#EDGE_RIGHT.
PiperOrigin-RevId: 493093973
2022-12-06 15:21:53 -05:00
afohrman
0f9c6fcab8 [Adaptive] [Side Sheet] Made SheetDialog abstract base class and Sheet interface package-private.
PiperOrigin-RevId: 492534084
2022-12-02 18:33:21 -05:00
afohrman
6476acde65 [Adaptive] [Side Sheet] Add @RestrictTo annotations to restrict SheetEdge annotation interface.
PiperOrigin-RevId: 492269491
2022-12-01 16:30:32 -05:00
afohrman
b384b9b535 [Adaptive] [Side Sheet] Made SideSheetBehavior extendable.
PiperOrigin-RevId: 492256730
2022-12-01 16:17:30 -05:00
afohrman
7a706cc82c [Adaptive] [Side Sheet] Add STATE_HIDDEN to SideSheetBehavior#getState javadoc.
STATE_HIDDEN was missing from the list of possible state constants returned by getState().

PiperOrigin-RevId: 489292973
2022-11-18 16:56:39 -05:00
afohrman
1653055b2c [Adaptive] [Side Sheet] Changed modal side sheet shape to large.
PiperOrigin-RevId: 487001390
2022-11-10 18:21:26 +00:00
afohrman
10d72eebec [Adaptive][Side Sheets] Added initial modal side sheet.
PiperOrigin-RevId: 482846478
2022-10-21 18:52:52 +00:00
raajkumars
8a4af07979 [Icon Buttons] Added support for toggleable Icon buttons.
PiperOrigin-RevId: 462638190
2022-07-25 11:20:13 -04:00
afohrman
d43416e3e4 [Side Sheets] Added new sidesheet package, new SideSheetBehavior, and basic standard side sheet demo to Adaptive Sheets catalog demo.
Does not include functionality or the modal side sheet. At the moment, the catalog demo includes a placeholder standard side sheet with a show/hide button that toggles the visibility between GONE and VISIBLE.

PiperOrigin-RevId: 462192554
2022-07-20 21:48:31 +00:00