2380 Commits

Author SHA1 Message Date
Material Design Team
bef8ca1b49 [M3][Color] Fix Resources Loader bug for color harmonization
PiperOrigin-RevId: 449926388
(cherry picked from commit 78d2c1f3db44c07fc84e6878fcd56bc2a5db310e)
2022-05-25 09:58:04 -07:00
Material Design Team
b33cf80dd7 [M3][Color] Provide better logging for ColorResourcesTableCreator
PiperOrigin-RevId: 449003101
(cherry picked from commit 29fddaa40a8c0f1ad15d91b8f72c8f7346a24f55)
2022-05-25 09:57:50 -07:00
Material Design Team
dff14cadd7 [AppBarLayout] Loosen check for scrollable child when adding a11y actions
Adding the a11y delegate and a11y actions was dependent on there being a CoordinatorLayout child that both inherits from certain scrolling classes (NestedScrollingChild, ListView, ScrollView) and has an AppBarLayout scrolling behavior. This was too restrictive and so we only check for a behavior.

Any scrolling child may add an a11y delegate or scroll action to the parent CoordinatorLayout.

PiperOrigin-RevId: 448335380
(cherry picked from commit 4b81bb1d1a467d03b6f323639f5358ec14445c67)
2022-05-25 09:57:33 -07:00
Material Design Team
a5a738bfa2 [AppBarLayout] Fix scrolling for a11y
Ensure the CoL can scroll to the bottommost elements of the scrolling child, which may not be visible due to the app bar.
Also, set the node info properties to expose the CoL to auto-scrolling.

PiperOrigin-RevId: 447596411
(cherry picked from commit 72228f4f35b0c155c870f59bc7c807e05443bf95)
2022-05-25 09:56:05 -07:00
Material Design Team
b402cb3c03 [M3][Color] Fix resources being re-harmonized when wrapContextIfAvailable() is used.
PiperOrigin-RevId: 446147925
(cherry picked from commit f0f07c5cf207e82bcbf05636a0919a09597a44b3)
2022-05-04 11:43:34 -04:00
Material Design Team
1dad5f65d4 [M3][Color] Add kyocera to dynamic colors allowlist and reorganized based on alphabetical order.
PiperOrigin-RevId: 445211233
(cherry picked from commit 66990a1da18fcf490f3de2c816af9f2298b9c350)
2022-05-04 11:32:14 -04:00
conradchen
2bfc7bae07 [SnackBar] Fix margins are added multiple times when show() is called
When a snack bar is hidden and its show() method is called, it will be added to the target parent, and at this moment the parent view will set the layout params to the snack bar, with the same existing margins if any. Therefore if the margins are already updated with extra margins, the original margins will be incorrectly updated. This CL introduces a flag to tells this situation from other "real" scenarios in which clients want to update their custom margins.

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

PiperOrigin-RevId: 445159923
(cherry picked from commit 46fa8cc45b8bb6d1423f7349986c7f3f4cdc5d4e)
2022-05-04 11:32:07 -04:00
Rikka
44054aaf3a [Color] Fix HarmonizedColorsOptions.Builder#setColorAttributes is marked as nullable
Resolves https://github.com/material-components/material-components-android/pull/2649

GIT_ORIGIN_REV_ID=b1f2d2ca1d4c5b25370eb0902fbf35729d6fc0a4
PiperOrigin-RevId: 442676674

(cherry picked from commit 824a12b7c80703d59a909496f3dbe0126d0dd899)
2022-04-19 13:42:22 -04:00
conradchen
2f3110ff5d [TopAppBar] Fix app:expanded=false not working
When an AppBarLayout is loaded, it will load the attribute and set up a non-forcing pending action. However when it's measured, the current scroll state will be saved and restored, which will override the non-forcing pending action. This behavior is incorrect - if there's a pending action, we shouldn't restore the scrolling state because it's meant to be changed.

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

PiperOrigin-RevId: 440960254
(cherry picked from commit 05be1b92c5720e4c6c6f42f93918bd6554099625)
2022-04-19 13:42:13 -04:00
pfthomas
9dd0952fd4 [MaterialDatePicker][a11y] Make picker header focusable to improve TalkBack response
PiperOrigin-RevId: 440375456
(cherry picked from commit c23daec8b1e217f92bb49ae9007c43cb47df9cd9)
2022-04-19 13:42:05 -04:00
conradchen
e1ee959b1b [DatePicker] Fix edge-to-edge mode being applied multiple times
When the date picker goes back from background to foreground, the onStart() method will be called and make enableEdgeToEdge() be called again. This will make it incorrectly use the header height and top padding already adjusted with system inset as the original height and padding, and thus add the inset multiple times.

Creates a flag to only enable edge-to-edge once to fix the issue.

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

PiperOrigin-RevId: 440110562
(cherry picked from commit c6a654c7dd68827a55d6d3dcda424cf6749678fa)
2022-04-19 13:41:53 -04:00
pfthomas
bed5c5997c [BadgeDrawable][a11y] Attach/detach badge contentDescription when using menuItem.
Resolves https://github.com/material-components/material-components-android/issues/2429

PiperOrigin-RevId: 439651014
(cherry picked from commit ee49c5aa8bed9b0c3a15421725b4f3164c3c6973)
2022-04-19 13:41:39 -04:00
Material Design Team
51093e19c0 [M3][Colors] Add additional condition to check dynamic color supported devices
PiperOrigin-RevId: 438770498
(cherry picked from commit 6fdc114bcd998ba6fab38c1d0d1469a0bd960100)
2022-04-19 13:41:27 -04:00
leticiars
4d788794ba [TextInputLayout] Fixed regression bug of prefix spacing being shown and making expanded label be in the wrong position when text field is not focused.
Resolves https://github.com/material-components/material-components-android/issues/2612

PiperOrigin-RevId: 437745108
(cherry picked from commit 784f901135c654e938a4b0a71252b6887a276244)
2022-04-19 13:41:14 -04:00
pfthomas
ebc9d19c32 [MaterialTimePicker][a11y] Make label important for accessibility
PiperOrigin-RevId: 437326760
(cherry picked from commit 0ba0d6540ad18f62970b6a9ac44ebea2397bce6e)
2022-04-19 13:41:04 -04:00
leticiars
a8d8e70d89 [TextInputLayout][a11y] Fixed text field's focused rect wrong behavior when using a11y magnification.
Before, in requestRectangleOnScreen we were setting the text input layout’s rectangle to a specific and constant position, which caused the zoomed in screen to be fixed to the left instead of following the input text as it was typed. We should use the edit text’s rectangle’s position first, then adjust for the text field’s height (which includes the helper/error text), then use that updated rectangle on the super call of the method.

PiperOrigin-RevId: 435402032
(cherry picked from commit dce4419744ba4e336e31a80521ab8a9ecb1136de)
2022-03-22 11:57:14 -04:00
pfthomas
981129f8ec [MaterialTimePicker][a11y] Update accessibility className used for hour/minute Chips
PiperOrigin-RevId: 436207977
(cherry picked from commit a51d1dcb68d51af7810272b63816067b983db3c1)
2022-03-22 11:44:00 -04:00
hunterstich
625252882d [NavigationRailView] Fix bottom padding being applied to top bug
PiperOrigin-RevId: 435636054
(cherry picked from commit 51739445315b818fa3b424903e0845a043c55357)
2022-03-22 11:43:39 -04:00
dsn5ft
f69e3a025b [MaterialToolbar] Fixed centering logic when title and subtitle are the same
Resolves https://github.com/material-components/material-components-android/issues/2303

PiperOrigin-RevId: 435348290
2022-03-17 11:41:23 -04:00
dsn5ft
8363cde162 [Color] Deprecate previous apply...() APIs and add overload for activity apply method with no options
PiperOrigin-RevId: 435344858
2022-03-17 11:40:47 -04:00
conradchen
e644a72aa7 Automated g4 rollback of changelist 435127325
PiperOrigin-RevId: 435152125
2022-03-17 11:40:14 -04:00
conradchen
493243ea1e [BottomSheet] Fix bottom sheets in EXPANDED state when the expanded height is the same as the collapsed height
Resolves https://github.com/material-components/material-components-android/issues/2335

PiperOrigin-RevId: 435127325
2022-03-17 11:39:42 -04:00
pfthomas
380778f992 [MaterialTimePicker][a11y] Give more context on hour/minute selection
PiperOrigin-RevId: 435119125
2022-03-16 19:31:02 +00:00
pekingme
ccfc0eecdf [Tokens] Upgraded to v0.79.
PiperOrigin-RevId: 434669243
2022-03-15 19:18:27 +00:00
jeremymuhia
cfc307ed4e [NavigationView] fix navigation view item ripple
PiperOrigin-RevId: 434516655
2022-03-14 18:55:40 +00:00
pekingme
91c25301db [Tokens] Migrated deprecated motion token generated resources.
PiperOrigin-RevId: 434493204
2022-03-14 18:54:01 +00:00
Material Design Team
69121c8b81 [M3][Colors] Add additional condition to check dynamic color supported devices
PiperOrigin-RevId: 434417515
2022-03-14 18:53:07 +00:00
pekingme
6a4fa0b991 [Tokens] Removed deprecated font family resource.
PiperOrigin-RevId: 433793454
2022-03-10 20:04:59 +00:00
Material Design Team
b70bbc2942 [M3][Color] Iteration on HarmonizedColors and DynamicColors feedback
Removed the Context/Application/Activity in the Builders class.
Updated docs accordingly and added examples explaining how harmonizing color attributes with theme overlay works.

PiperOrigin-RevId: 433769484
2022-03-10 20:04:09 +00:00
pekingme
ca8594d2d2 [Slider] Added LABEL_VISIBLE to label behavior and added a demo fragment in catalog.
Resolves https://github.com/material-components/material-components-android/issues/1316

PiperOrigin-RevId: 433570701
2022-03-09 22:14:31 +00:00
pekingme
e7a691e067 [Tokens] Added missing palette token generated resources.
PiperOrigin-RevId: 433519901
2022-03-09 22:13:29 +00:00
pekingme
a5b78e659c [Tokens] Added new shape appearance styles.
PiperOrigin-RevId: 433486068
2022-03-09 22:12:26 +00:00
leticiars
b9a21f0d97 [a11y][ExposedDropdownMenu] Fixed end icon focus in a11y mode when a11y mode is turned on/off after views have been attached. Also added a11y tests.
PiperOrigin-RevId: 433472357
2022-03-09 22:11:21 +00:00
Material Design Team
4e97f7879b Suppress new nullness warnings when stub for View.getLayoutParams is added.
PiperOrigin-RevId: 433207765
2022-03-09 22:07:00 +00:00
conradchen
04c483cf34 [CleanUp][BottomSheet] Simplify state transition logic
Reduces and restructures the calling chain when a state is set to improve readability and robustness.

This CL also introduces the following fixes:

1. Limit the possible input values of setState() and throws IllegalArgumentException if invalid values are provided.
2. Block the state to be set as HIDDEN when hideable is false.
3. Fix the bug that SettleRunnable could be posted multiple times due to isPosted flag being incorrectly set to false when the settling is still going on.
4. Fix the bug that dragging the bottom sheet when settling would result the bottom sheet in an incorrect state (the target state of settling instead of DRAGGING).

PiperOrigin-RevId: 432963533
2022-03-09 21:08:53 +00:00
conradchen
9a46af2af2 [CleanUp][TextField] Extract start components from TextInputLayout
PiperOrigin-RevId: 432953110
2022-03-09 21:07:45 +00:00
pekingme
b4d445064f [Tokens] Added lineHeight attr into TextAppearance.
PiperOrigin-RevId: 432493474
2022-03-04 17:00:43 -05:00
pfthomas
1b14715cde [MaterialTimePicker][a11y] Prevent TalkBack from announcing unavailable action
PiperOrigin-RevId: 432453483
2022-03-04 16:59:26 -05:00
pfthomas
47781d58b7 [MaterialTimePicker][a11y] Fix TalkBack announcing wrong selection between hour/minute
PiperOrigin-RevId: 432440771
2022-03-04 16:52:36 -05:00
conradchen
be6050a23c [DatePicker] Always go edge-to-edge in fullscreen mode
Resolves https://github.com/material-components/material-components-android/issues/1966

PiperOrigin-RevId: 432296692
2022-03-04 13:06:17 -05:00
conradchen
78b532c420 [Slider] Refine javadocs of thumb radius setters
PiperOrigin-RevId: 432265042
2022-03-04 13:05:29 -05:00
afohrman
108558326d [TextInputLayout] Added class documentation to use TextInputLayout's context to construct the child TextInputEditText.
We already had class documentation that explains that TextInputEditText should be instantiated with the parent TextInputLayout's context for proper theming, but this  information is important enough to the basic usage of TextInputLayout and TextInputEditText that it's best to have it the class documentation, as well.

Added the guidance in both TextInputLayout and TextInputEditText because it's relevant to both classes.

PiperOrigin-RevId: 432244388
2022-03-04 13:03:37 -05:00
Material Design Team
7b51353c84 [M3][Color] Updated dark tone values for ColorRoles.
Spec: https://m3.material.io/styles/color/the-color-system/color-roles
Resolves https://github.com/material-components/material-components-android/issues/2584
PiperOrigin-RevId: 432152216
2022-03-03 10:06:34 -05:00
jeremymuhia
9c2df2811c [TabLayout] tabs with padding in fixed mode shouldn't scroll
Resolves https://github.com/material-components/material-components-android/issues/2410

PiperOrigin-RevId: 432032683
2022-03-03 09:56:30 -05:00
pfthomas
9cdf4c9559 [MaterialTimePicker][a11y] Fix wrong clock item selection
PiperOrigin-RevId: 431938695
2022-03-02 14:19:28 -08:00
Material Design Team
bfb6086e24 [M3][Color] Update getters/setters naming in the HarmonizedColorsOptions
PiperOrigin-RevId: 431700407
2022-03-02 14:16:44 -08:00
pekingme
2ae676c5d9 [Tokens][Motion] Added fundamental resources for pathinterpolator.
PiperOrigin-RevId: 431554031
2022-03-01 08:59:29 -08:00
pekingme
51821176a8 [Tokens] Internal cleanup.
PiperOrigin-RevId: 431547939
2022-03-01 08:58:31 -08:00
conradchen
9789f2e286 [CleanUp][TextField] Split icon tinting logic to a helper class
PiperOrigin-RevId: 431477762
2022-03-01 08:55:44 -08:00
hunterstich
f3d7ca4014 [Tokens] Ignore NewApi lint check for typography fontFamily.
PiperOrigin-RevId: 430978528
2022-02-25 10:36:06 -08:00