2294 Commits

Author SHA1 Message Date
pfthomas
0f2b5378f7 [Top App Bar][ActionMode] Make title and subtitle match ActionBar's
Resolves https://github.com/material-components/material-components-android/issues/2189

PiperOrigin-RevId: 425712147
2022-02-01 22:00:53 -08:00
pfthomas
f9914da4e9 [TimePicker][a11y] Fix Switch Access can't reach clock items
PiperOrigin-RevId: 425684600
2022-02-01 13:56:37 -08:00
Material Design Team
dff1e4edf1 [TextAppearance] Clamp typeface weight when adjusting it
PiperOrigin-RevId: 425440606
2022-01-31 18:15:11 -08:00
Material Design Team
5dce006a5c [CollapsingToolbarLayout] Constrain adjusted font weight to acceptable values
PiperOrigin-RevId: 425438646
2022-01-31 18:13:57 -08:00
conradchen
b3db1cc028 [Badge] Prevent multiple badges being attached to a menu item at the same time
Fixes the logic in NavigationBarMenuView.restoreBadgeDrawables(), which may override the newly created badges with the restored drawables incorrectly. Also adds a safe guard that removes the previously attached badges if any, before attaching a new badge.

PiperOrigin-RevId: 424923078
2022-01-31 18:12:50 -08:00
conradchen
3cf23e4bf1 [Snackbar] Solve lint error caused by @IntDef
It seems like lint won't take both @IntDef and @IntRange into consideration at the same time. Just uses @IntRange to cover all possible values.

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

PiperOrigin-RevId: 424918785
2022-01-28 11:56:33 -08:00
afohrman
2463946d24 [TextInputLayout] Add line mask expansion animation to filled box underline.
Add an expanding animation for the focused underline that's triggered when the edit text gains focus. The line mask animation is built to calculate its bounds based on the hint CollapsingTextHelper's expansion fraction, so it seamlessly follows that animation.

PiperOrigin-RevId: 424703815
2022-01-28 11:55:08 -08:00
pekingme
53863287d6 [Tokens] Re-upgraded to v0.73.
PiperOrigin-RevId: 424635556
2022-01-27 09:54:21 -08:00
pubiqq
10edcd11d5 [ChipDrawable] Support setting text color programmatically.
Resolves https://github.com/material-components/material-components-android/pull/2526

GIT_ORIGIN_REV_ID=d1f47b5aa0b823ae0915d4c7ae85417e7d0eddd5
PiperOrigin-RevId: 424632069
2022-01-27 09:53:18 -08:00
hunterstich
c66633b385 [NavigationRail] Added support for opting in/out of the NavigationRail automatically adding system top and bottom window insets.
PiperOrigin-RevId: 424424554
2022-01-27 09:51:41 -08:00
conradchen
0c8fc4144e [M3][Color] Add missing M3 color attributes to public
Resolves https://github.com/material-components/material-components-android/issues/2538

PiperOrigin-RevId: 424403413
2022-01-27 09:50:52 -08:00
conradchen
1c5c054b70 [Dialog] Fix crashes when colorControlHighlight is a CSL
We set ?attr/colorControlHighlight as scroll indicators' background attribute. However, on older platforms this will crash the app due to Android expects a drawable or a plain color for the background attribute.

Changes the view to TextView so it will be rendered as MaterialTextView, which supports app:backgroundTint with CSLs. Also changes the base background color to #1F000000 and the tint color to ?attr/colorForeground, which are aligned with what framework's alert dialog implementation is doing.

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

PiperOrigin-RevId: 423917985
2022-01-25 14:48:33 -05:00
dsn5ft
96fa85e216 [MaterialButtonToggleGroup] Removed getAccessibilityClassName() override since TalkBack doesn't recognize the class name, in favor of getting identified as a generic list container
PiperOrigin-RevId: 423814546
2022-01-24 15:47:55 -05:00
pfthomas
7d46b95e9e [TextInputLayout] Add support for minEms and maxEms
Resolves https://github.com/material-components/material-components-android/issues/2269

PiperOrigin-RevId: 423118234
2022-01-24 14:48:13 -05:00
Material Design Team
285fa9de30 Automated g4 rollback of changelist 422930284
PiperOrigin-RevId: 422949121
2022-01-20 10:24:30 -05:00
Material Design Team
c52b95d4d5 Automated g4 rollback of changelist 420096508
PiperOrigin-RevId: 422930284
2022-01-19 19:34:23 -05:00
dsn5ft
b84f35f121 [Color] Update DynamicColors util to use activity.getTheme().applyStyle() instead of activity.setTheme() to workaround Force Dark issue
Resolves https://github.com/material-components/material-components-android/issues/2521

PiperOrigin-RevId: 422816956
2022-01-19 11:15:01 -05:00
pekingme
d0e0d9404d [Tokens] Downgraded token resources to v0.71.
PiperOrigin-RevId: 421954490
2022-01-18 12:04:57 -05:00
conradchen
3cf0647da0 [Slider] Fix lint error caused by hidden super interface
Overriding the inherited methods from a hidden super interface to fix lint errors caused by those methods being hidden.

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

PiperOrigin-RevId: 421909180
2022-01-18 12:03:14 -05:00
conradchen
6c41f070e8 [Button] Support icon gravity with text alignments other than centered
Resolves https://github.com/material-components/material-components-android/issues/1371

PiperOrigin-RevId: 421605261
2022-01-18 12:02:02 -05:00
conradchen
8342f9025e [M3][Dialog] Add date and time picker themes to M3 dialog themes
Also moves all theme overlays to separate files for internal building purpose.

PiperOrigin-RevId: 421385265
2022-01-13 12:18:05 -05:00
conradchen
698cf9b45e [AppBarLayout] Save and restore scroll state during scroll range recalculation
When scroll range changes, the current scroll position may not make sense anymore. Therefore we need to save the scroll state and restore it after the scroll range is invalidated. This change reuses and refactors the existing saving instance state logic to support this need. Also adds a flag to denote "fully expanded" state to avoid improper scroll position calculation when views are still being initialized.

PiperOrigin-RevId: 421348135
2022-01-13 12:15:17 -05:00
dsn5ft
8f4837e059 [MaterialCheckBox] Horizontally center the checkbox button drawable if there is no text
PiperOrigin-RevId: 421304994
2022-01-12 11:30:33 -05:00
jeremymuhia
90787bf0e0 [TextAppearance] fix drawables not applying system level bold
PiperOrigin-RevId: 421066050
2022-01-12 11:21:15 -05:00
conradchen
a74675177f [Badge] Internal change
PiperOrigin-RevId: 420376250
2022-01-12 11:20:32 -05:00
dsn5ft
48741b4e16 [Color] Avoid Short#compare usage in ColorResourcesTableCreator.java since it requires API level 19
PiperOrigin-RevId: 420358384
2022-01-12 11:19:45 -05:00
pekingme
4527272319 [Tokens] Upgraded token resources to v0.73.
PiperOrigin-RevId: 420329292
2022-01-12 11:18:41 -05:00
pekingme
4de8565634 [Tokens] Upgrade M3 token resources to v0.71
PiperOrigin-RevId: 420319663
2022-01-12 11:16:06 -05:00
conradchen
bbbeacd64e [Badge] Refactor Badge state managing logic
This CL fixes a couple of badge state related issues. First, it prevents the badges created before restoring instance states from being overwritten by the old instance states. Second, it makes badges reload their default style settings everytime when its being recreated so if the environment has been changed, the default values will reflect the environment change.

This CL also fixes that several attributes were not correctly saved/restored or their default values were not correctly loaded.

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

PiperOrigin-RevId: 420096508
2022-01-06 15:51:50 -05:00
conradchen
3db25be3b6 [ButtonGroup] Simplify MaterialButtonToggleGroup's checking logic
1. Consolidates single selected ID and multiple selected IDs to a single selected
   ID set.
2. Separates View states and internal checked states so we can focus and enforce
   policies much easier on only internal states.

PiperOrigin-RevId: 420087718
2022-01-06 15:44:19 -05:00
conradchen
ff97a6805c [SnackBar] Enforce vertical layout when action text is too long
The snack bar content layout is by default horizontal, and we only change it to vertical when the action view is too wide and ellipsizes the message text. Therefore if the layout orientation is already vertical, we should just keep the layout and no need to check if the message text is multi-line again.

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

PiperOrigin-RevId: 419885582
2022-01-05 23:26:51 -05:00
conradchen
a43d7d993c [M3][Theme] Internal change
PiperOrigin-RevId: 419602208
2022-01-04 18:01:05 -05:00
pfthomas
8bc64201d4 [AlertDialog][a11y] Make dialog icon not important for accessibility
Resolves https://github.com/material-components/material-components-android/issues/1400

PiperOrigin-RevId: 419600919
2022-01-04 18:00:22 -05:00
Material Design Team
bc811d231b Automated g4 rollback of changelist 418911641
PiperOrigin-RevId: 418915787
2022-01-04 17:59:36 -05:00
pfthomas
bd15f071e1 [AlertDialog][a11y] Make dialog icon not important for accessibility
Resolves https://github.com/material-components/material-components-android/issues/1400

PiperOrigin-RevId: 418911641
2022-01-04 17:58:32 -05:00
conradchen
246b3400ec [M3][Dialog] Fix dialog icon color tint
Only tints dialog icons when it's an SVG with colorControlNormal, which is the common default color used by vector icons.

PiperOrigin-RevId: 418666657
2021-12-29 13:56:43 -05:00
conradchen
a17af6ee04 Automated g4 rollback of changelist 418054400
PiperOrigin-RevId: 418062580
2021-12-28 11:44:12 -05:00
conradchen
747bcf25ff [ButtonGroup] Simplify MaterialButtonTogglerGroup's checking logic
1. Consolidates single selected ID and multiple selected IDs to a single selected
   ID set.
2. Separates View states and internal checked states so we can focus and enforce
   policies much easier on only internal states.

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

PiperOrigin-RevId: 418054400
2021-12-28 08:55:31 -05:00
Vyacheslav
26d862bc54 [TextInputLayout] Speedup simple inflate.
Changes are mostly to keep start/end layouts and icon views hidden (visibility = gone) when they are not needed.

Resolves https://github.com/material-components/material-components-android/pull/2326

GIT_ORIGIN_REV_ID=0393ac65d562bc87d340ec7bb260ebba99a1ac3b
Co-authored-by: leticiarossi <9288695+leticiarossi@users.noreply.github.com>
PiperOrigin-RevId: 418038435
2021-12-28 08:54:28 -05:00
conradchen
88eb089021 [TextField] Apply edit text's letter spacing to expanded hints
Resolves https://github.com/material-components/material-components-android/issues/2202

PiperOrigin-RevId: 417863400
2021-12-23 13:54:06 -05:00
hunterstich
a295de9728 [TabLayout] Added fade inidcator animation mode.
PiperOrigin-RevId: 417842993
2021-12-22 14:48:54 -05:00
conradchen
dac9bf360a [M3][Color] Set android:windowBackground to android:colorBackground
The same remapping is done on API 21+ by framework base themes. On API levels lower than 21, AppCompat base themes "backport" the behavior to map window background to a separate color resources. With Material 3 we want a consistent and clear behavior, this CL explicitly remaps android:windowBackground to android:colorBackground so the behavior will be the same across all API levels.

PiperOrigin-RevId: 417711790
2021-12-22 14:47:20 -05:00
conradchen
672e7440f9 [M3][Dialog] Fix dialog paddings
We missed to include top/bottom insets of button styles into dialog action margin calculation. Also the paddings between titles and messages were not correct.

PiperOrigin-RevId: 417626927
2021-12-22 14:46:19 -05:00
conradchen
2ae3ca4298 [M3][ActionBar] Migrate action bar popup themes to M3
PiperOrigin-RevId: 417454499
2021-12-20 16:11:30 -05:00
leticiars
9416b2c7d6 [Divider] Added attribute in MaterialDividerItemDecoration to remove item decoration from last recycler view item.
PiperOrigin-RevId: 416890397
2021-12-20 15:57:15 -05:00
conradchen
7665730a0b [M3][Theme] Remove unneeded TODOs in M3 themes
PiperOrigin-RevId: 416835249
2021-12-16 14:38:41 -05:00
dsn5ft
c6527d177b [M3][Colors] Add additional condition to check dynamic color supported devices
PiperOrigin-RevId: 416582032
2021-12-16 14:37:30 -05:00
conradchen
e7bc947cd5 [DatePicker] Replace fragment container with FragmentContainerView
As suggested in https://developer.android.com/reference/androidx/fragment/app/FragmentContainerView

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

PiperOrigin-RevId: 416323969
2021-12-14 14:54:29 -05:00
conradchen
833f410404 [Color] Add additional condition to check dynamic color supported devices
PiperOrigin-RevId: 415066134
2021-12-09 01:18:43 +00:00
Material Design Team
822a5b2cb2 [M3][Color] Add Resource Table format for XML color Harmonization.
PiperOrigin-RevId: 415021439
2021-12-09 01:14:46 +00:00