2601 Commits

Author SHA1 Message Date
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
hunterstich
5b50bf13a2 [Transitions] Fix container transform easing mapping.
PiperOrigin-RevId: 444901780
2022-04-27 13:32:37 -04:00
hunterstich
e151b7a8ae [Transitions] Update shared axis, fade through, and fade to use new easing and duration system.
PiperOrigin-RevId: 444897183
2022-04-27 13:31:00 -04:00
dsn5ft
a71781355e [Snackbar] Add shape theming support and update M3 style to use new shapeAppearanceCornerExtraSmall
PiperOrigin-RevId: 444883546
2022-04-27 12:37:04 -04:00
dsn5ft
64bdf9e2b7 [Slider] Add back deleted tooltip shape appearance
PiperOrigin-RevId: 444877713
2022-04-27 12:13:12 -04:00
dsn5ft
391d2b2c34 [MaterialAlertDialog] Update M3 style to use new shapeAppearanceCornerExtraLarge attr
PiperOrigin-RevId: 444852173
2022-04-27 10:23:46 -04:00
hunterstich
f2f454ba8a [Motion] Update container transform to use new motion system.
PiperOrigin-RevId: 444848054
2022-04-27 10:12:54 -04:00
leticiars
0e4e44e8cd [TextInputLayout] Updated shape to use M3 attrs/styles.
PiperOrigin-RevId: 444647020
2022-04-27 10:09:51 -04:00
leticiars
75af80cf46 [Slider] Updated tooltip shape style to use M3 value.
PiperOrigin-RevId: 444643192
2022-04-27 10:07:01 -04:00
conradchen
e3bd856567 [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.

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

PiperOrigin-RevId: 444595599
2022-04-26 14:09:24 -04:00
pubiqq
7109aa4b8b [i18n][Date/Time Picker] Use regular strings instead of @android:string/* which can have translation issues
Resolves https://github.com/material-components/material-components-android/issues/2655
Resolves https://github.com/material-components/material-components-android/pull/2656

PiperOrigin-RevId: 444574063
2022-04-26 12:02:43 -04:00
Material Design Team
714521b4ac [Divider] Fixed extra space when lastItemDecorated = false
Resolves https://github.com/material-components/material-components-android/issues/2511

PiperOrigin-RevId: 444556765
2022-04-26 12:02:02 -04:00
pekingme
921868d31b [BottomSheet] Migrated shape appearance to new shape system.
PiperOrigin-RevId: 443484334
2022-04-25 09:27:33 -04:00
dsn5ft
b62b9a50b0 [Gradle] Update library source and target compatibility to Java 8 and add lambda + method reference usage
PiperOrigin-RevId: 443370295
2022-04-21 16:29:39 -04:00
conradchen
431e291b01 [Translation] Update string translations
PiperOrigin-RevId: 443191056
2022-04-20 17:19:02 -04:00
conradchen
72abed042f [TimePicker] Restore hour/minute selection when switch to text mode
This also opens the keyboard automatically when switching the input mode.

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

PiperOrigin-RevId: 443096864
2022-04-20 14:04:46 -04:00
pfthomas
5b78bf4896 [MaterialTimePicker][a11y] Fix label for hour/minute EditTexts.
PiperOrigin-RevId: 443080572
2022-04-20 13:39:25 -04:00
pekingme
6217aa8581 [Shape] Added theme attributes and styles for new shape appearances.
PiperOrigin-RevId: 442925211
2022-04-20 12:55:55 -04:00
pubiqq
3ca41be8f0 [General] Fix typos
Resolves https://github.com/material-components/material-components-android/pull/2654

GIT_ORIGIN_REV_ID=b8f6728979875629f2c813ef90d2f671cf56b4eb
PiperOrigin-RevId: 442852630
2022-04-19 14:48:55 -04:00
conradchen
a0e8c35470 [CleanUp][TextField] Create EndIconDelegate.deactivate() method and remove the relevant listener
PiperOrigin-RevId: 442846789
2022-04-19 13:57:46 -04:00
pfthomas
1ad4682fee Automated g4 rollback of changelist 437775591
PiperOrigin-RevId: 442829220
2022-04-19 12:39:30 -04:00
dsn5ft
d6c435461e [AppBarLayout] Add setLiftOnScrollTargetView() method
Resolves https://github.com/material-components/material-components-android/pull/2544

PiperOrigin-RevId: 442823082
2022-04-19 12:02:59 -04:00
Rikka
824a12b7c8 [Color] Fix HarmonizedColorsOptions.Builder#setColorAttributes is marked as nullable
Resolves https://github.com/material-components/material-components-android/pull/2649

GIT_ORIGIN_REV_ID=b1f2d2ca1d4c5b25370eb0902fbf35729d6fc0a4
PiperOrigin-RevId: 442676674
2022-04-19 10:59:04 -04:00
conradchen
45b99f603e [Button] Fix the issue that button state is not updated
On Lollipop, when first assigned as View's background, RippleDrawable won't/can't propagate states to its content drawable. This causes the issue that the state relevant features like stroke colors are not correctly updated when the background is recreated. Explicitly assigns states to the content drawable to fix the issue.

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

PiperOrigin-RevId: 442676637
2022-04-19 10:57:43 -04:00
conradchen
5b9f27aad0 [SnackBar] Make dismiss direction the same as swipe direction
In SwipeDismissBehavior, when dismissing views according to the horizontal velocity instead of position delta, we would still using position delta to decide the dismissing direction, which, unfortunately, makes the view always be dismissed from left to right because of the "less than" logic we are using doesn't really take the equaling case into account. Fixes this by using the velocity direction to dismiss the view instead.

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

PiperOrigin-RevId: 442553318
2022-04-18 13:12:46 -04:00
conradchen
788866e448 [Chip] Fix chip layout not updated when programmatically setting text size
We didn't forward Chip.setTextSize() call properly to ChipDrawable.setTextSize(). Fixes this by properly overriding the method.

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

PiperOrigin-RevId: 442056225
2022-04-15 14:18:11 -04:00