2525 Commits

Author SHA1 Message Date
hunterstich
0d91f4ac3b [Motion] Add motion easing xml interpolators and theme attributes.
PiperOrigin-RevId: 435639751
2022-03-18 18:52:15 +00:00
hunterstich
5173944531 [NavigationRailView] Fix bottom padding being applied to top bug
PiperOrigin-RevId: 435636054
2022-03-18 18:51:17 +00:00
conradchen
7c160c86fb [CleanUp][TextField] Create EndIconDelegates in an on-demand fashion
This should slightly improve the text field rendering performance.

PiperOrigin-RevId: 435411420
2022-03-18 18:50:15 +00:00
leticiars
dce4419744 [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
2022-03-17 18:52:42 +00:00
conradchen
6cdf7b5155 [CleanUp][TextField] Extract end components from TextInputLayout
PiperOrigin-RevId: 435390505
2022-03-17 18:51:39 +00:00
pekingme
a878690a93 [Tokens] Upgraded to v0.86.
PiperOrigin-RevId: 435371390
2022-03-17 18:48:53 +00: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
Material Design Team
869d943067 [M3][Color] Add support for color resources harmonization in XML
PiperOrigin-RevId: 430757816
2022-02-25 03:54:09 -08:00
conradchen
43114c4f7c [BottomSheet] Fix activity leak when setting states on destroying activities
The activity leak can happen in a corner case: setting bottom sheet state when the bottom sheet is dismissed and the host activity is closed. In this situation SettleRunnable will be posted to ViewRootImpl since the bottom sheet is not attached, which leaves references of the dismissed bottom sheet (and thus the destroyed activity) in ViewRootImpl and causes activity leak.

Fixes this by using weak reference in SettleRunnable instead of the strong reference, which is the standard practice of the BottomSheetBehavior class.

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

PiperOrigin-RevId: 430709002
2022-02-25 03:53:30 -08:00
pekingme
37fcd242bd [Tokens][Cleanup] Better ordering in the output.
PiperOrigin-RevId: 430479085
2022-02-23 11:23:09 -08:00
afohrman
1222268437 [BottomNavigationView] Added supported NavigationBarView#LabelVisibilityMode alternative to deprecated BottomNavigationView#LabelVisibilityMode.
PiperOrigin-RevId: 430230181
2022-02-23 11:21:14 -08:00
leticiars
b6901275d9 [TextInputLayout][a11y] Fixed prefix/suffix not being properly announced when the text field is focused and they show up. Also improved their screen reader focus order to align with the visual order of the elements: navigating to the left will focus on the prefix and navigating to the right will focus on the suffix.
Resolves https://github.com/material-components/material-components-android/issues/2497

PiperOrigin-RevId: 430208388
2022-02-23 11:13:30 -08:00
dsn5ft
45841c97fe [Color] Remove constructor comments from DynamicColorsOptions.Builder
PiperOrigin-RevId: 430202113
2022-02-23 11:11:21 -08:00
conradchen
17da000a29 [Slider] Add support for custom thumb drawables
Resolves https://github.com/material-components/material-components-android/issues/1522

PiperOrigin-RevId: 429607888
2022-02-23 11:10:12 -08:00
Material Design Team
bdbf052aaf [M3][Color] Refactor DynamicColors overloading methods and added DynamicColorsOptions class to support color harmonization.
PiperOrigin-RevId: 429324480
2022-02-18 15:43:45 +00:00
pekingme
878ea36a79 [Tokens] Generated TextAppearance styles instead of atomic typography resources.
PiperOrigin-RevId: 429161102
2022-02-18 15:42:24 +00:00
conradchen
19af0ac9d9 [BottomSheet] Update edge-to-edge paddings when bottom sheet is laid out
Since adding bottom sheet behavior callbacks won't trigger any callbacks to be called, the bottom sheet paddings won't be updated right away. This causes the issue that top paddings are not correctly applied when the bottom sheet is initially expanded. Besides that, due to some unknown reason, bottom sheet's getTop() method will only return a non-zero value that is the offset to the container top when calling from bottom sheet behavior callbacks. It seems related to how ViewCompat.offsetTopAndBottom() is working. Not 100% sure.

Therefore this CL add a internal callback to BottomSheetCallback class so when bottom sheet is being laid out (and getting offset), we can update paddings right away.

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

PiperOrigin-RevId: 429071367
2022-02-18 15:41:23 +00:00
dsn5ft
b49284ec75 [M3][Toolbar] Hide shadows on all M3 Toolbar styles, not just Surface style
Resolves https://github.com/material-components/material-components-android/issues/2552

PiperOrigin-RevId: 429059800
2022-02-18 15:40:35 +00:00
raajkumars
18554d9cb5 [BottomNavigationView] Fix for IllegalArgumentException in preview mode.
Resolves https://github.com/material-components/material-components-android/issues/2489

PiperOrigin-RevId: 428861308
2022-02-15 21:29:32 +00:00