2993 Commits

Author SHA1 Message Date
Material Design Team
d287c805c4 [M3][ColorUtilities] Internal Color Utilities Library update
PiperOrigin-RevId: 543777709
2023-06-27 19:14:49 +00:00
hunterstich
ad60bbf5d9 [Predictive Back] Fixed MaterialBackAnimationHelper.onCancelBackProgress being called twice.
PiperOrigin-RevId: 543622236
2023-06-27 19:05:56 +00:00
rightnao
27abfdba4f [Badge] Deprecate bottom badge gravities and update docs and usages in catalog
PiperOrigin-RevId: 543527285
2023-06-27 18:55:22 +00:00
rightnao
6b48d3bb80 [Carousel] Add vertical scrolling capability
PiperOrigin-RevId: 542943240
2023-06-27 13:37:53 +00:00
rightnao
2362f4b64b [Badge][NavigationRail] Add new attribute for vertical offset when font is large
PiperOrigin-RevId: 542366571
2023-06-26 23:37:57 +00:00
rightnao
29d8742917 [Carousel] Deprecate set/get mask x percentages in Maskable as they are no longer used anywhere, and is a misleading method due to these methods not actually having any effect on the Carousel as CarouselLayoutManager overrides the values.
PiperOrigin-RevId: 542347361
2023-06-26 21:40:18 +00:00
Material Design Team
bdef355289 [TextInputEditText]Fix: TextInputEditText misses some visible lines in CursorAnchorInfo#getVisibleLineBounds after scrolled
TextInputEditText#getGlobalVisibleRect is overridden to call getGlobalVisibleRect on parent TextLayoutInput view directly. It doesn't match with the View#getGlobalVisibleRect implementation where the return globalOffset contains negative amount of the scroll in the view. As a result, calling getLocalVisibleRect will return a wrong rectangle when TextInputEiditText is scrolled.

PiperOrigin-RevId: 542341678
2023-06-26 21:26:12 +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
pfthomas
917da52393 [NavigationDrawer] Do not count headers for accessibility
PiperOrigin-RevId: 540975970
2023-06-26 21:25:15 +00:00
Material Design Team
52b7ff21ec [M3][ColorUtilities] Internal Color Utilities Library update
PiperOrigin-RevId: 540948389
2023-06-26 21:24:34 +00:00
Material Design Team
a81008f83e [M3][ColorUtilities] Internal Color Utilities Library update
PiperOrigin-RevId: 540938594
2023-06-26 21:24:04 +00:00
Material Design Team
8e7ab4da91 [M3][ColorUtilities] Internal Color Utilities Library update
PiperOrigin-RevId: 540923527
2023-06-26 21:23:38 +00:00
rightnao
8b016a0e8b [NavigationRail][Badge] Added bigger padding in between items on the navigation rail when font scale is large so there is more room for the badges when they are forced inside the view bounds
Also fixed bug with navigation rail items moving when there is a badge vs when there is no longer a badge, and adds 4dp padding between icon container/active indicator and label text as per specs https://m3.material.io/components/navigation-rail/overview

PiperOrigin-RevId: 540349399
2023-06-14 12:47:57 -07: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
rightnao
9486de5f2f [Carousel] Ensure that masks are pushed out beyond the parent bounds if they are _on_ the parent bounds
PiperOrigin-RevId: 540105089
2023-06-14 15:14:54 +00:00
pfthomas
022e217770 [Navigation] Add itemTextAppearanceActiveBoldEnabled attr
Resolves https://github.com/material-components/material-components-android/issues/3191
Resolves https://github.com/material-components/material-components-android/issues/3293

PiperOrigin-RevId: 539977391
2023-06-14 15:14:24 +00:00
pfthomas
4d8043453e [MaterialDatePicker] Allow client app to access user selected inputMode
Resolves https://github.com/material-components/material-components-android/pull/3414

PiperOrigin-RevId: 539713099
2023-06-14 15:13:51 +00:00
pekingme
f18819949c [Color] Internal cleanup.
PiperOrigin-RevId: 538268914
2023-06-09 07:59:24 -07:00
rightnao
16c1575758 [Carousel] Carousel updates and fixes
- If item width is more than twice the item height, limit the width to twice the item height and add a medium item to the hero variant of the carousel.
- Fix snaphelper to snap to closest keyline state instead of always the default keyline state
- Add new KeylineStatePositionList to keep track of which keyline states to be in for each position. Update scrollToPosition methods to take the correct keyline instead of default keyline

PiperOrigin-RevId: 537955672
2023-06-06 15:56:43 +00:00
rightnao
7d6a977d50 [Carousel] Fix contained mask logic to only update masks when it is still in view, and remove restrictions on mask size with childWidth/2F. The only restriction is that the right of the mask must be greater than the left of the mask.
PiperOrigin-RevId: 537080963
2023-06-05 18:42:52 +00: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
2b5c75f966 [Resource Inspection] Set up Android Studio resource inspection annotation and annotation processor, and add @Attribute annotation to MaterialButton#getIconPadding
PiperOrigin-RevId: 536411748
2023-05-30 15:46:52 +00:00
Michael Totschnig
dae89b7ce2 [Dialog] Update DialogWhenLarge theme to have correct parent theme
Resolves https://github.com/material-components/material-components-android/pull/3402

Resolves https://github.com/material-components/material-components-android/issues/3400

Co-authored-by: imhappi
GIT_ORIGIN_REV_ID=8aee44c6a45954096083b06540e5aa1058eff34b
PiperOrigin-RevId: 534921469
2023-05-30 15:27:22 +00:00
pfthomas
1fcde2c8b2 [MaterialTimePicker] Fix crash when clicking OK/Cancel/Icon on text input mode due to hiding keyboard
PiperOrigin-RevId: 534824218
2023-05-24 14:29:55 +00:00
hunterstich
85b6d5018d [Carousel] Fixed multi browse strategy clipping extra small items before being fully collapsed
This moves mask rect calculation from MaskableFrameLayout into CarouselLayoutManager so CarouselLayoutManager can change the offsetting of the mask inside a child and clip according to both the keylines and the carousel container boundary.

PiperOrigin-RevId: 533082558
2023-05-22 18:34:32 +00:00
Material Design Team
a511501286 [M3][Color] Updated content-based dynamic colors
PiperOrigin-RevId: 532182583
2023-05-16 19:58:14 +00:00
rightnao
340cd44b07 [Carousel] Add Hero carousel strategy
PiperOrigin-RevId: 531247503
2023-05-11 19:14:21 +00:00
leticiars
46778db594 [Gradle] Update AppCompat dependency to 1.6.1
This fixes Proguard warnings about ShadowDrawableWrapper.

Resolves https://github.com/material-components/material-components-android/issues/3374

PiperOrigin-RevId: 530651081
2023-05-09 13:38:23 -04:00
dsn5ft
577d23eceb [Search] Fix expand/collapse animation for non-predictive back cases where rootView bounds are not equal to searchView bounds
PiperOrigin-RevId: 530596832
2023-05-09 13:15:20 -04:00
dsn5ft
7ccf6708b0 [MaterialDatePicker] Fix crash when clicking OK/Cancel on text input mode due to hiding keyboard
PiperOrigin-RevId: 529835294
2023-05-08 14:53:58 -04:00
rightnao
8938da8c28 [Carousel] Add CarouselSnapHelper
PiperOrigin-RevId: 529457461
2023-05-04 17:00:56 -04: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
rightnao
1c27404fc5 [Carousel] Refactor to reuse logic between different Carousel strategy classes
- Moved Arrangement class outside of MultiBrowseStrategy
- Added helper class CarouselStrategyHelper and moved common logic in MultiBrowseStrategy to CarouselStrategyHelper

PiperOrigin-RevId: 528924778
2023-05-03 16:06:57 -04:00
dsn5ft
2f135323b3 Automated g4 rollback of changelist 528735653
PiperOrigin-RevId: 528800431
2023-05-02 16:14:14 -04:00
Material Design Team
a3af01ce79 Automated g4 rollback of changelist 528599594
PiperOrigin-RevId: 528735653
2023-05-02 16:13:39 -04:00
dsn5ft
2a1a67f076 [Color] Temporarily remove v34 Android U color references which could be causing resource NotFoundExceptions
PiperOrigin-RevId: 528599594
2023-05-02 16:12:29 -04:00
pekingme
1562d0b64f [ExposedDropdownMenu] Added attribute to set dropdown menu's container.
PiperOrigin-RevId: 528578402
2023-05-02 16:10:48 -04: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
pekingme
824d75e773 [Color] Fixed lint error.
PiperOrigin-RevId: 527739167
2023-04-28 14:46:02 -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
Material Design Team
a6cf0985c4 [M3][Color] Added ColorContrast API
PiperOrigin-RevId: 527645245
2023-04-27 16:39:34 -04:00
hunterstich
c031144d26 [NavigationView] Updated NavigationView to use ViewOutlineProvider to handle corner clipping when possible and remove drawerLayoutCornerClippingEnabled attribute.
PiperOrigin-RevId: 527633449
2023-04-27 16:38:17 -04: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
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
pfthomas
29b59c21f5 [MaterialDatePicker] Add getTextColor to DayViewDecorator
PiperOrigin-RevId: 527265648
2023-04-26 16:19:16 -04:00
pekingme
6980c40f12 [TopAppBar] Updated to take a CSL as the AppBarLayout background color.
PiperOrigin-RevId: 527090028
2023-04-26 16:18:09 -04:00