2660 Commits

Author SHA1 Message Date
dsn5ft
e981f2f96c [Snackbar] Add defensive null check for messageView.getLayout() in SnackbarContentLayout onMeasure
PiperOrigin-RevId: 452776106
2022-06-03 11:59:14 -07:00
conradchen
e9b5328490 [Switch] Tokenize the new switch styles
PiperOrigin-RevId: 452763569
2022-06-03 11:56:35 -07:00
conradchen
132ff888ea [BottomSheet] Update javadoc of setHideable() method
It actually affects both swiping and setting the state programmatically. Removes the description regarding swiping to make it more accurate.

PiperOrigin-RevId: 452684555
2022-06-03 11:55:45 -07:00
pekingme
d0c3ea0eb5 [Tokens] Upgraded token resources to v0.99.
PiperOrigin-RevId: 452574141
2022-06-02 15:41:39 -07:00
conradchen
2d3024ea10 [BottomSheet] Fix BottomSheetDialog edge-to-edge mode
PiperOrigin-RevId: 452302946
2022-06-02 10:05:29 -07:00
conradchen
a9a57af629 Automated g4 rollback of changelist 452075757
PiperOrigin-RevId: 452112331
2022-05-31 13:50:56 -07:00
conradchen
072578dde6 [Switch] Refine tinting logic to have better performance
Move the unchecked and checked state calculation off from each invalidate() call to onCreateDrawableState() so we can make sure we will only calculate the states when needed.

PiperOrigin-RevId: 452092712
2022-05-31 13:50:12 -07:00
conradchen
fd8d30d55c [BottomSheet] Fix BottomSheetDialog edge-to-edge mode
Replace the usage of deprecated setSystemUiVisibility() with WindowCompat.setDecorFitsSystemWindows(). The original implementation will override any existing system visibility flags, so this CL also fixes the issue that certain existing system visibility settings like light navigation bar is reset.

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

PiperOrigin-RevId: 452075757
2022-05-31 13:49:38 -07:00
conradchen
ea12f84f2b [FAB] Fix the issue that state-list animator cannot be customized
Before this CL we always reset the state-list animator when FAB elevation changes, i.e., any state-list animators set via XML will be overridden because elevation is set later. Fixes this by storing the default state-list animator created in onElevationsChanged() and check if it's been overridden before we update and reset it.

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

PiperOrigin-RevId: 452073249
2022-05-31 13:48:53 -07:00
raajkumars
7d0f1badea [Material Theme] Added isMaterial3DynamicColorApplied attr to identify whether dynamic colors are being used in a theme.
PiperOrigin-RevId: 451486255
2022-05-31 13:36:11 -07:00
conradchen
2f33cfc213 [Switch] Add thumb icon tint to the new switch styles
PiperOrigin-RevId: 451422588
2022-05-31 13:32:39 -07:00
conradchen
69e484dd1e [ProgressIndicator] Make progress indicator drawables scalable by setBounds()
Resolves https://github.com/material-components/material-components-android/issues/2364

PiperOrigin-RevId: 451214292
2022-05-26 16:16:49 -04:00
conradchen
06bba009d4 [Switch] Add associated text styles
Also increases the min height to match the min touch target size.

PiperOrigin-RevId: 450987495
2022-05-26 16:16:11 -04:00
conradchen
1e08c680d4 [Switch] Add material switch style to M3 themes
Also add public attributes to public.xml

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

PiperOrigin-RevId: 450782655
2022-05-25 15:17:43 -04:00
pekingme
3db2109311 [ExFAB] Migrated to new shape system.
PiperOrigin-RevId: 450741383
2022-05-25 15:16:34 -04:00
conradchen
53086a0533 [BottomSheet] Add back accidentally removed setLightStatusBar method and annotate it as deprecated
PiperOrigin-RevId: 450696352
2022-05-24 13:23:43 -04:00
conradchen
1a91e683a3 [BottomSheet] Fix bottom sheet dialog status bar color adjustment
This CL fixes two issues regarding bottom sheet dialog status color adjustment in edge-to-edge mode:

1. Uses WindowInsetsControllerCompat to set status bar color to replace the deprecated way of setting flags, which cannot override the light/dark setting set by WindowInsetsControllerCompat.
2. Tracks Window change so the original status bar color can be updated when the dialog is re-shown. (The day/night mode can be changed when the dialog is hidden.)

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

PiperOrigin-RevId: 450463570
2022-05-24 13:16:26 -04:00
rightnao
21f9b0ff25 [BottomAppBar] Add a callback for whenever bottom view hides/unhides through scrolling
PiperOrigin-RevId: 450449206
2022-05-24 13:13:10 -04:00
pubiqq
382ce9c792 [TopAppBar] Fix copy constructors
Resolves https://github.com/material-components/material-components-android/pull/2686

GIT_ORIGIN_REV_ID=7f62b56c7edf01046e85b474d1cf0f17c6153b68
PiperOrigin-RevId: 450440535
2022-05-23 11:20:15 -04:00
conradchen
a3ca744776 [Switch] Create icon style for the new switch design
PiperOrigin-RevId: 450037491
2022-05-23 11:19:33 -04:00
pekingme
30bb583f20 [FAB] Migrated "Large" styles to use new shape system.
PiperOrigin-RevId: 450021484
2022-05-23 11:18:39 -04:00
pekingme
acc75697ea [FAB] Added "Small" styles with new shape system.
PiperOrigin-RevId: 450003295
2022-05-23 11:13:49 -04:00
Material Design Team
78d2c1f3db [M3][Color] Fix Resources Loader bug for color harmonization
PiperOrigin-RevId: 449926388
2022-05-23 11:07:01 -04:00
pekingme
65120923d5 [Token][Switch] Added token generated resources.
PiperOrigin-RevId: 449904422
2022-05-23 11:04:09 -04:00
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