2469 Commits

Author SHA1 Message Date
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
Sebastian K\u00fcrten
61cbb8c9a6 [ProgressIndicator] Fix indeterminate progress indicator not working on API 22
Resolves https://github.com/material-components/material-components-android/pull/2675
Resolves https://github.com/material-components/material-components-android/issues/2028

GIT_ORIGIN_REV_ID=eaf535ee18b85d8c062eeb58f59a7ea2fdb91f48
PiperOrigin-RevId: 445914955
2022-05-02 09:31:49 -04:00
hunterstich
f700e6d6f1 [NavigationRail] Update active indicator to use new shape system.
PiperOrigin-RevId: 445912992
2022-05-02 09:23:10 -04:00
conradchen
1a42c743fe [CleanUp][TextField] Move drop-down background and ripple creation to TextInputLayout class
This CL also cleans up and fixes the edit text background setting logic - when the edit text is an autocomplete text view and provides its own background, we won't override the background by trying to add ripples to it.

Later they should be split again from the main class with other box-background-relevant logic.

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

PiperOrigin-RevId: 445486075
2022-05-02 09:19:04 -04:00
conradchen
3fa48d4cd5 [Shape] Workaround the issue that Context.obtainStyledAttributes() doesn't handle @macro properly
Somehow Context.obtainStyledAttributes() with a provided style resource crashes if some attributes in the style are resolved to be macros. Using ContextThemeWrapper to wrap the context with the style doesn't have this issue. Workarounds this by always wrapping the context to retrieve attributes.

PiperOrigin-RevId: 445451176
2022-04-29 14:50:17 -04:00
Material Design Team
940c8aafd8 Automated g4 rollback of changelist 444595599
PiperOrigin-RevId: 445446957
2022-04-29 14:34:16 -04:00
Material Design Team
66990a1da1 [M3][Color] Add kyocera to dynamic colors allowlist and reorganized based on alphabetical order.
PiperOrigin-RevId: 445211233
2022-04-28 16:27:40 -04:00
Venugopal Rao Gubbala
7b043c3b68 [CollapsingToolbarLayout] Allow application to Set ellipsis to Title in CollapsingToolBar
Resolves https://github.com/material-components/material-components-android/pull/2636

GIT_ORIGIN_REV_ID=f6c2b07c1eb936ed2de47b7586688a5f6b322e48
PiperOrigin-RevId: 445200467
2022-04-28 16:26:58 -04:00
conradchen
bfce84a27c [Card] Migrated shape appearance to new shape system.
PiperOrigin-RevId: 445180046
2022-04-28 16:25:56 -04:00
pfthomas
b1f7d5bebc [NavigationView][a11y] Announce number of items in drawer
Resolves https://github.com/material-components/material-components-android/issues/678

PiperOrigin-RevId: 445165922
2022-04-28 12:40:24 -04:00
conradchen
46fa8cc45b [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
2022-04-28 12:37:45 -04:00