2636 Commits

Author SHA1 Message Date
rightnao
4ded01ed3f [TextInputLayout] Add a new custom length counter field and getters/setters to switch how text length is calculated for the counter.
Resolves https://github.com/material-components/material-components-android/issues/2418

PiperOrigin-RevId: 449842640
2022-05-23 10:21:23 -04:00
pekingme
c3406dc3ab [Tokens] Upgrade resources to v0.95.
PiperOrigin-RevId: 449840889
2022-05-20 15:19:31 -04:00
pekingme
a1e83052d9 [Tokens] Regenerated token resources with <macro> type.
PiperOrigin-RevId: 449829080
2022-05-20 15:18:57 -04:00
conradchen
80d5ba5894 [Switch] Internal change
PiperOrigin-RevId: 449794117
2022-05-20 15:13:01 -04:00
Material Design Team
b3a7dafe6e [M3][Color] Update Dynamic Colors condition
PiperOrigin-RevId: 449782139
2022-05-19 14:28:10 -04:00
conradchen
3b257c0169 [Switch] Support tinting thumb & track according to thumb position
PiperOrigin-RevId: 449760154
2022-05-19 14:27:11 -04:00
conradchen
2db8b0cd5a [TextField] Link OnItemSelectedListener of AutoCompleteTextView with the actual drop-down list
Framework has no default implementation of how or when OnItemSelectedListener will be called. We need to link it with the actual ListPopupWindow we are going to show.

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

PiperOrigin-RevId: 449725174
2022-05-19 14:24:31 -04:00
conradchen
73cb1b6e78 [TextField] Fix hint is not displayed when expanding space is limited
In CollapsingTextHelper we are checking both the expanded bound and the collapsed bound to be larger than 0 to decide if we are going to draw the collapsing text. However this can result in a situation that when there's no space to display expanded hint, the collapsed hint won't be drawn either, even if the hint is not expandable at all.

This CL fixes the issue in a more generic way - whenever draw() is called, we check if the current bound (should be calculated whenever the collapsing fraction is changed) is larger than 0 to decide if we need to draw the collapsing text.

This CL also adds the logic to ensure the cutout bound will never be larger than the collapsed bound.

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

PiperOrigin-RevId: 449597658
2022-05-18 21:14:13 -04:00
raajkumars
673cefc714 [TextInputLayout] Fix for TextInputLayout leak via AccessibilityManager.
Resolves https://github.com/material-components/material-components-android/issues/2615

PiperOrigin-RevId: 449517571
2022-05-18 21:12:36 -04:00
rightnao
be1b38c30b [BottomSheet] Exposing bottom sheet hide friction with get/set methods.
PiperOrigin-RevId: 449334214
2022-05-18 11:13:08 -04:00
dsn5ft
2ac796fdf4 [MaterialToolbar] Add null check for logo ConstantState check
Resolves https://github.com/material-components/material-components-android/issues/2708

PiperOrigin-RevId: 449305810
2022-05-17 22:16:43 -04:00
hunterstich
722756e389 [BottomAppBar] Updated FAB alignment mode slide animation to use new motion attributes.
PiperOrigin-RevId: 449287560
2022-05-17 22:15:22 -04:00
conradchen
72bac616cc [Switch] Add a workaround to get thumb position
PiperOrigin-RevId: 449249966
2022-05-17 14:56:30 -04:00
conradchen
fd40fea461 [Switch] Override switch width set by AppCompat to respect the drawable width
PiperOrigin-RevId: 449238028
2022-05-17 14:55:17 -04:00
conradchen
413a047957 [ChipGroup] Fix ChipGroup.getCheckedChipIds() returns wrong state
In the Chip implementation, onCheckedChangeListener was called before onCheckedChangeListenerInternal. This causes an issue that in onCheckedChangeListener's callback, the checkable group's checked state is not updated yet, therefore ChipGroup.getCheckedChipIds() will return the outdated checked state.

Fixes this by overriding Chip.setOnCheckedChangeListener to get full control of the execution order between onCheckedChangeListener and onCheckedChangeListenerInternal.

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

PiperOrigin-RevId: 449100861
2022-05-17 11:04:03 -04:00
rightnao
934985ec53 [FAB] Updated FAB to use new motion attributes.
PiperOrigin-RevId: 449046932
2022-05-16 17:00:22 -04:00
conradchen
ac74bc3bfd [CleanUp][TextField] Centralize icon view state handling logic
Note that there are a slight behavior changes - when a new end icon mode is set, the state will always be reset, if applicable. This should be logically more consistent and correct than the current behavior.

PiperOrigin-RevId: 449027939
2022-05-16 16:09:50 -04:00
conradchen
1e7bd27a29 [Switch] Implement track decoration in the new design
The default decoration will be a track outline in the unchecked state.

PiperOrigin-RevId: 449013525
2022-05-16 15:14:47 -04:00
Material Design Team
29fddaa40a [M3][Color] Provide better logging for ColorResourcesTableCreator
PiperOrigin-RevId: 449003101
2022-05-16 15:14:06 -04:00
Material Design Team
703249d872 [MaterialTimePicker] Properly align text vertically in MaterialTimePicker on S+.
PiperOrigin-RevId: 448541243
2022-05-13 15:01:43 -04:00
Material Design Team
4b81bb1d1a [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
2022-05-12 17:24:36 -04:00
Bruno Coelho
4d4f3ccd8f [BottomSheetDialogFragment] Added constructor with layout ID and update appCompat version
Resolves https://github.com/material-components/material-components-android/pull/2525

GIT_ORIGIN_REV_ID=3f6c5e53830910fb98a287024731a2dfdc5e5efb
PiperOrigin-RevId: 448320717
2022-05-12 17:22:49 -04:00
pekingme
269830e94e [Shape][TimePicker] Clean up shape appearance hardcoded in layout files.
PiperOrigin-RevId: 448297165
2022-05-12 17:21:53 -04:00
conradchen
1414f9e480 [Switch] Add thumb and track drawables for the new switch design
PiperOrigin-RevId: 448253424
2022-05-12 17:18:46 -04:00
raajkumars
467a2c9f73 [Button] Updated M3 button style to add outlined icon button style. Updated catalog to showcase the same.
PiperOrigin-RevId: 448118229
2022-05-12 17:17:21 -04:00
pfthomas
91a2550afd [DatePicker] Migrate to new shape system
PiperOrigin-RevId: 448057183
2022-05-12 17:15:26 -04:00
pekingme
cfeb31a3f2 [Shape][NavView] Migrate M3 NavigationView style to new shape system.
PiperOrigin-RevId: 448042553
2022-05-11 15:01:26 -04:00
pfthomas
85c40a6a51 [MaterialDatePicker] Internal change
PiperOrigin-RevId: 448042520
2022-05-11 15:00:27 -04:00
conradchen
86b512a81c [CleanUp][TextField] Move end icon and content description logic to the layout class
PiperOrigin-RevId: 448036109
2022-05-11 14:59:46 -04:00
pfthomas
d4c2c95490 [Chip][a11y] Make multi-selection Chips announced as Buttons
PiperOrigin-RevId: 447993125
2022-05-11 14:58:44 -04:00
pubiqq
5d6678cc66 [MaterialDatePicker] Hide the keyboard when switching to calendar mode
Resolves https://github.com/material-components/material-components-android/pull/2688
Resolves https://github.com/material-components/material-components-android/issues/2687

GIT_ORIGIN_REV_ID=686526aa049eadb08ded72ca9eb0b60027358756
PiperOrigin-RevId: 447819486
2022-05-11 09:41:38 -04:00
raajkumars
14578ed68c [Button] Updated M3 button style to add filled tonal icon button style. Updated catalog to showcase the same.
PiperOrigin-RevId: 447784383
2022-05-10 15:05:30 -04:00
conradchen
d3ab6d7bf1 [CleanUp][TextField] Centralize accessibility event dispatching logic for drop-downs
This also fixes the bug that clients cannot use custom AccessibilityDelegate with drop-down mode.

PiperOrigin-RevId: 447748501
2022-05-10 15:04:34 -04:00
Material Design Team
72228f4f35 [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
2022-05-10 09:48:55 -04:00
conradchen
b2a3fbe1f3 [Switch] Create a base skeleton of the new MaterialSwitch package/class
PiperOrigin-RevId: 447532839
2022-05-10 09:37:52 -04:00
leticiars
6206ff5a1f [ExposedDropdownMenu] Added support for default/ripple background colors for the selected item of the exposed dropdown menu when the default MaterialAutoCompleteArrayAdapter is being used.
PiperOrigin-RevId: 447531152
2022-05-09 17:35:43 -04:00
pekingme
3fc53ac51f [Shape][Chip] Migrate M3 chip styles to new shape system.
PiperOrigin-RevId: 447526976
2022-05-09 15:01:32 -04:00
raajkumars
25606cf34a [Button] Updated M3 button style to add filled icon button style. Updated catalog to showcase the same.
PiperOrigin-RevId: 447523530
2022-05-09 15:00:34 -04:00
hunterstich
1995438305 [NavigationBar][NavigationRail] Updated active indicator to use new motion system.
PiperOrigin-RevId: 447463375
2022-05-09 14:48:11 -04:00
conradchen
363e2b1708 [Button] Always update drawable state when background changed
In certain situations drawable states won't be correctly propagated to the background drawable wrapped in a LayerDrawable during setting view background. Always explicitly updates the drawable state to fix the issue.

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

PiperOrigin-RevId: 446786432
2022-05-06 12:13:07 -04:00
hunterstich
9a16aa471b [NavigationBar] Update active indicator to new shape system.
PiperOrigin-RevId: 446760684
2022-05-05 15:16:50 -04:00
conradchen
0c341c4e9b [TopAppBar] Fix collapsing title issue with different fonts
When the collapsing title is fully expanded, the current logic won't update the linear text setting correctly to false, which may result in the issue that the type face is not updated correctly. Fixes this by always updating linear text settings when the available text width is not 0.

Also refactors the typeface relevant logic so we will decide if we should recreate the static text layout in a consistent way.

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

PiperOrigin-RevId: 446735260
2022-05-05 15:15:16 -04:00
raajkumars
402bdf4bbe [Button] Added materialIconButtonStyle attribute and updated M3 doc to document icon (only) button style and attribute.
PiperOrigin-RevId: 446487810
2022-05-04 18:27:31 -04:00
pfthomas
f302da7401 [TimePicker] Migrate to new shape system
PiperOrigin-RevId: 446302694
2022-05-04 18:26:34 -04:00
conradchen
7b2f92443a [CleanUp][TextField] Remove TextInputLayout.getEditText() calls from EndIconDelegates
PiperOrigin-RevId: 446240046
2022-05-03 15:06:11 -04:00
conradchen
1d3bb00de2 [Button] Migrated shape appearance to new shape system.
PiperOrigin-RevId: 446183150
2022-05-03 12:53:54 -04:00
Material Design Team
f0f07c5cf2 [M3][Color] Fix resources being re-harmonized when wrapContextIfAvailable() is used.
PiperOrigin-RevId: 446147925
2022-05-03 11:49:35 -04:00
conradchen
526ce8c6c5 [TopAppBar] Fix margins not applied when collapsed and expanded text size and type face are the same
We missed to check if the available text width is changed when deciding if we should recreate the static text layout. Adds the check to fix the issue.

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

PiperOrigin-RevId: 445941276
2022-05-02 11:45:14 -04:00
dsn5ft
8c775cb418 [i18n][Date/Time Picker] Update date and time picker translation strings
Resolves https://github.com/material-components/material-components-android/issues/2655
Resolves https://github.com/material-components/material-components-android/pull/2656

PiperOrigin-RevId: 445930808
2022-05-02 11:44:04 -04:00
conradchen
2c0e42f56a [TextField] Fix icon ripples go behind the edit text
On API 21 & 22, the borderless ripple will go behind the container view under certain conditions. Setting a mask when creating the ripple drawable to restrain the ripple inside view bounds somehow solves the issue.

PiperOrigin-RevId: 445920587
2022-05-02 09:52:55 -04:00