2357 Commits

Author SHA1 Message Date
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
pekingme
1304522beb [BottomSheet] Fixed IME bottom padding is ignored in edge-to-edge case. Reverted to use deprecated getSystemWindowInsetBottom() for bottom inset to align with behaviors in 1.5.0.
Resolves: https://github.com/material-components/material-components-android/issues/2543
PiperOrigin-RevId: 428856163
2022-02-15 21:28:33 +00:00
P1NG2WIN
b01051b8bc [MaterialToolbar] Support scaleType and adjustViewBounds for logo
Resolves https://github.com/material-components/material-components-android/pull/2562

GIT_ORIGIN_REV_ID=c675c6a12e2fc242d2e9e019913df650b87eea2b
PiperOrigin-RevId: 428837808
2022-02-15 19:52:03 +00:00
conradchen
85ed9938d7 [TextField] Provide set simple items API with default item layout for MaterialAutoCompleteTextView
Resolves https://github.com/material-components/material-components-android/issues/692

PiperOrigin-RevId: 428832331
2022-02-15 19:33:49 +00:00
conradchen
13dbc9f906 [BottomSheet] Support background tint without shape appearance set
Resolves https://github.com/material-components/material-components-android/issues/2200

PiperOrigin-RevId: 428781539
2022-02-15 19:26:40 +00:00
pfthomas
85a44054f3 [MaterialTimePicker] Add setters for hour and minute
Resolves https://github.com/material-components/material-components-android/issues/2515

PiperOrigin-RevId: 428563049
2022-02-15 19:24:16 +00:00
pekingme
6bf92e1c07 Automated g4 rollback of changelist 426304311
PiperOrigin-RevId: 428054428
2022-02-11 20:27:52 -08:00
dsn5ft
56ed07008b [Color] Update DynamicColors to use peekDecorView() instead of getDecorView() when applying dynamic color theme overlay
Resolves https://github.com/material-components/material-components-android/issues/2558

PiperOrigin-RevId: 428033173
2022-02-11 20:27:06 -08:00
pekingme
64c6d047a9 [Tokens] Updated copyright year.
PiperOrigin-RevId: 427833895
2022-02-11 15:47:03 +00:00
pekingme
86e8b00ecd [CollapsingToolbarLayout] Fixed shadow issues when transition between expanded and collapsed states.
Includes two main fixes:
1. Applied a workaround for alpha issue of shadow layer in Paint for API 31(+).
- Issue: For API 31 and plus, Paint doesn't apply the correct alpha value to the shadow layer. When the shadow color is opaque (alpha=255), the alpha of shadow should use the alpha of the Paint. But it seems the inverse alpha (255-alpha) is applied to the shadow layer.
- Solution: Added a workaround to set shadow color with a real-time alpha value, Paint still respects to the shadow color's alpha when it's not opaque.

2. Fixed rounding issue when blending shadow color for API 30(-).
- Issue: The rounding of alpha value in removed blendColors() function is casting (round down). This causes the shadow color occasionally becomes non-opaque. Then Paint stops to apply the alpha value to it.
- Solution: When blending colors, round values with Math.round() (round to nearest).

Note: Fix (1) covers fix (2). But fix (2) is still worth to keep, if issue (1) is fixed in the framework in future and workaround is removed.

Resolves: https://github.com/material-components/material-components-android/issues/2545
PiperOrigin-RevId: 427812326
2022-02-11 15:45:15 +00:00
conradchen
d5856fd036 [Snackbar] Fix the issue that setting margins programmatically does not work
We always use the original margins saved when the snackbar is created to update snackbar's actual margins. Therefore the newly set margins will always be overridden. Fixes this by updating original margins when layout params are set.

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

PiperOrigin-RevId: 427795853
2022-02-11 15:43:45 +00:00
leticiars
1b7e92d99c [TextInputLayout] Updated documentation to clarify end icon mode's expected usage and behaviors relating to the icon's drawable.
Resolves https://github.com/material-components/material-components-android/issues/2528

PiperOrigin-RevId: 427506995
2022-02-11 15:41:02 +00:00