3071 Commits

Author SHA1 Message Date
rightnao
e708d98c74 [TabLayout] Re-adding mistakenly removed tab layout theme
PiperOrigin-RevId: 523239345
2023-04-11 20:47:24 -07:00
rightnao
b706506c3d [Badge] Add attribute to automatically adjust badge so that it is within the anchor view's grandparent view's bounds
PiperOrigin-RevId: 523171594
2023-04-11 20:00:06 -07: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
Material Design Team
0a4e419242 Automated g4 rollback of changelist 522443049
PiperOrigin-RevId: 523143316
2023-04-11 19:57:22 -07:00
Material Design Team
9c4b73da3a [BottomSheetBehavior] Fix for detached from bottom sheet behavior.
When max height of BottomSheetBehavior is specified the calculations of top inset do not account for the max height parameter and may override internal `childHeight` variable used for inset calculation with parentHeight. This may cause top inset to be too small and end up letting BottomSheetBehavior content be scrolled above bottom of the screen (the content might end up "floating" above the bottom of the screen).
The CL ensures that overridden `childHeight` is coerced to a min value of parent or maxHeight parameter in cases when maxHeight was set.

PiperOrigin-RevId: 523126749
2023-04-11 19:55:56 -07:00
pubiqq
7bc26e5070 [Carousel] Fix item masking for API 21
Resolves https://github.com/material-components/material-components-android/pull/3330

GIT_ORIGIN_REV_ID=1c46e2882b074e35ab1f19af0af00f88dee84f4c
PiperOrigin-RevId: 523119333
2023-04-11 19:55:10 -07:00
dsn5ft
176ce5e5f0 [Predictive Back][Search] Add ability to opt-out of back handling
PiperOrigin-RevId: 522626762
2023-04-10 15:06:53 +00:00
raajkumars
203d5ec3a3 [M3][Search] Improve performance by preventing item change notifications during inflation.
PiperOrigin-RevId: 522612855
2023-04-10 15:05:58 +00:00
hunterstich
0184b5baa9 [Carousel] Updated MultiBrowseCarouselStrategy to find best arrangments using a cost function
This changes the way arrangements are found by:
* Finding all possible arrangements of items
* Sort the arrangement candidates using a cost function that optimizes for total space fit, large item size retention, and adherence to other input params
* Fit and use the top arrangement to work within the carousel's available space

PiperOrigin-RevId: 522568015
2023-04-10 15:03:52 +00:00
pekingme
cf006c5e10 [Search] Made SearchBar and SearchView's container colors configurable in XML style.
PiperOrigin-RevId: 522468493
2023-04-10 15:03:01 +00:00
pekingme
303fabd331 [Dialog] Made dialog background color configurable in XML styles.
PiperOrigin-RevId: 522443049
2023-04-10 14:57:51 +00: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
pfthomas
ec511a54cf [MaterialDatePicker] Update screen width at which days size is 48dp in portrait mode.
PiperOrigin-RevId: 521476833
2023-04-10 14:42:10 +00:00
leticiars
c598ccd51e [TextInputLayout] Added API to set cursor colors for API 28+.
This is useful if the cursor color should be set in runtime, where setting ?attr/colorControlActivated for the edit text is not possible. Using the added APIs will take precedence over the value of ?attr/colorControlActivated.

This API is limited to APIs 28+ due to the framework getTextCursorDrawable() method being 28+.

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

PiperOrigin-RevId: 521448134
2023-04-10 14:23:58 +00:00
rightnao
a0d0b53472 [Badge] Add getters/setters for vertical and horizontal badge padding
PiperOrigin-RevId: 520969935
2023-03-31 18:35:53 +00:00
pekingme
d722a782bc [Tokens] Upgraded outdated token output in textfield & appbar.
PiperOrigin-RevId: 520714140
2023-03-30 21:58:22 +00:00
pekingme
4c5b917609 [Tokens] Internal migration.
PiperOrigin-RevId: 520708971
2023-03-30 21:56:43 +00:00
dsn5ft
5a37e4b35f [Gradle] Update to AGP 7.4.2 to get latest lint and fix Android U lint issues
PiperOrigin-RevId: 520691813
2023-03-30 18:15:24 +00: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
pekingme
b3f7b6604e [AppBarLayout] Fixed dragging the app bar layout overshoots the status bar.
Resolves https://github.com/material-components/material-components-android/issues/3316

PiperOrigin-RevId: 520466126
2023-03-30 15:55:50 +00:00
pubiqq
c1ef52b8ea [Badge] Allow text strings in badges
Resolves https://github.com/material-components/material-components-android/pull/2978
GIT_ORIGIN_REV_ID=39c9f60cff607fba1e9ca57ae8bc155c5919e503
Co-authored-by: imhappi
PiperOrigin-RevId: 520368686
2023-03-29 19:18:22 +00:00
dsn5ft
2c23d2a158 [Predictive Back][Bottom Sheet] Fix bug where standard hideable bottom sheets don't stay hidden after predictive back
It wasn't an issue for modal bottom sheets because they dismiss the whole window when the bottom sheet behavior is hidden

Also updated Bottom App Bar demo drawer to opt into predictive back, which is a standard hideable bottom sheet

PiperOrigin-RevId: 520312905
2023-03-29 19:16:12 +00:00
raajkumars
11599231a9 [M3][Search] Fixed a crash in search components when view attributes inspection dev setting is turned on.
PiperOrigin-RevId: 520131513
2023-03-29 19:05:42 +00:00
pekingme
7b2c19b273 [DatePicker] Made dialog container color configurable in xml style.
PiperOrigin-RevId: 520113790
2023-03-29 19:04:50 +00:00
leticiars
62aa802f6c [Checkbox] Fixed checkmark icon not updating color on error correctly in pre 21.
Issue happened on checkboxes that switched from unchecked to checked and later to be on error state.

Fixes https://github.com/material-components/material-components-android/issues/3302

PiperOrigin-RevId: 520088272
2023-03-29 19:03:57 +00:00
pfthomas
bcc97bfaf5 [MaterialDatePicker] Fix hint for Korean
PiperOrigin-RevId: 520025180
2023-03-28 16:20:46 +00:00
pekingme
dfbf4d9c2c [Cleanup] Minor fix.
PiperOrigin-RevId: 519997026
2023-03-28 16:19:46 +00:00
raajkumars
cdda1fc66e [Search] Added support to pass toolbar style.
PiperOrigin-RevId: 519876161
2023-03-28 16:18:25 +00:00
rightnao
fc0de1ba24 [Badge] Center badge content more correctly
PiperOrigin-RevId: 519835048
2023-03-28 16:14:53 +00:00
pekingme
30ea33e948 [Datepicker] Integrated tokens.
PiperOrigin-RevId: 519201395
2023-03-24 19:24:16 +00:00
pekingme
5f542c8946 [TimePicker] Made dialog container color configurable in xml style.
PiperOrigin-RevId: 519184711
2023-03-24 18:08:08 +00: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
pekingme
0be665cfc0 [Tokens] Updated to v0.162 for a new target.
PiperOrigin-RevId: 518680159
2023-03-23 18:14:41 +00:00
rightnao
8499b83ba1 [BadgeDrawable] Add padding in between top and bottom edges of badge and text
PiperOrigin-RevId: 518370027
2023-03-21 20:50:42 +00:00
Material Design Team
206a4684fd [M3][Color] Color component internal update
PiperOrigin-RevId: 518068669
2023-03-20 21:26:33 +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
hunterstich
93ceb7edee [Carousel] Add support for transitions by forcing canvas clipping when detaching from the window.
PiperOrigin-RevId: 517963541
2023-03-20 21:24:55 +00:00
pekingme
9f1caa2c64 [Tokens] Upgraded to v0.162.
PiperOrigin-RevId: 517446114
2023-03-20 21:23:07 +00:00
hunterstich
0a0bff1489 Automated g4 rollback of changelist 515410464
PiperOrigin-RevId: 517409678
2023-03-20 21:21:59 +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
pekingme
93f386c9f6 [Tokens/Color] Added U color resources for contrast mode support.
PiperOrigin-RevId: 517236590
2023-03-20 21:08:12 +00:00
hunterstich
43c507775f [Carousel] Updated MaskableFrameLayout to use Outline path clipping on 33+ only.
PiperOrigin-RevId: 517128236
2023-03-16 15:26:15 +00:00
hunterstich
3f993923b2 [NavigationRailView] Added attribute to control the application of start window inset padding.
PiperOrigin-RevId: 516904093
2023-03-15 21:10:53 +00:00
conradchen
d6f36e89e2 [FAB] Correctly handle min touch target size
In the original logic we only handle touching down events happening within the "actual" button area, which breaks the min touch target size enforcement. Fixes this by calculating the correct area of touch target when handling touching down events.

PiperOrigin-RevId: 516600706
2023-03-14 22:12:22 +00:00
hunterstich
3856af1b65 [Carousel] Updated setForceCompatClipping visibility for testing.
PiperOrigin-RevId: 516584087
2023-03-14 22:09:22 +00:00
hunterstich
733c9e08c2 [Carousel] Updated MaskableFrameLayout to clip more performantly.
Clipping is now handled differently depending on the shape being used and API level.
* 30+ always uses a ViewOutlineProvider
* 21+ uses a ViewOutlineProvider when the shape is a round rect
* All other API levels and cases fall back to canvas clipping

PiperOrigin-RevId: 516297199
2023-03-13 21:21:48 +00:00
hunterstich
0c62df4a60 Automated g4 rollback of changelist 515343383
PiperOrigin-RevId: 515410464
2023-03-13 21:20:02 +00:00
Material Design Team
ea6b514d00 [M3][Color] Internal color updates
PiperOrigin-RevId: 515348671
2023-03-13 21:18:35 +00:00
hunterstich
1d2a59ba37 [NavigationRail][NavigationBar] Fixed active item focused state color not being visible.
The color state list used for the ripple to indicate focal/hover state was being set as the background of an item and being obscured by the active indicator. It is now the foreground and visible on top of the active indicator.

PiperOrigin-RevId: 515343383
2023-03-13 21:17:13 +00:00
hunterstich
359580b6c1 [Carousel] Changed Maskable.add/removeOnMaskChangedListener to Maskable.setOnMaskChangedListener.
This change is to prevent the case of items in a RecyclerView.Adapter being recycled and re-bound and having more and more listeners added to a MaskableFrameLayout.

PiperOrigin-RevId: 515048125
2023-03-08 21:30:15 +00:00