2547 Commits

Author SHA1 Message Date
pfthomas
be8e4e2d9a [MaterialDatePicker] Improve error formatting
PiperOrigin-RevId: 459495629
2022-07-07 12:30:40 -07:00
pubiqq
74b7706de9 [ShapeableImageView] Don't change layer type when view is detached from the window
When the exit transition starts, the layer type is set to LAYER_TYPE_NONE (inside onDetachedFromWindow). In this case, clearPaint (Paint with Xfermode = PorterDuff.Mode.DST_OUT) stops working correctly.
The patch just deletes the layer type setup from onDetachedFromWindow, leaving the layer type set to LAYER_TYPE_HARDWARE.

Resolves https://github.com/material-components/material-components-android/issues/2703
Resolves https://github.com/material-components/material-components-android/pull/2792

GIT_ORIGIN_REV_ID=b05230b40529251b8b16cc02f1cfd64f3801c1d8
PiperOrigin-RevId: 459308833
2022-07-06 13:15:46 -07:00
pubiqq
0c56a45639 [MaterialTimePicker] Refine AM/PM toggle logic
Resolves https://github.com/material-components/material-components-android/pull/2803

GIT_ORIGIN_REV_ID=f5b301b86b8a91189b8199f924b8f837bd7d3fcd
PiperOrigin-RevId: 459256240
2022-07-06 13:08:18 -07:00
pubiqq
15fa4db616 [TextInputLayout] Fix "android:enabled" attribute support
Resolves https://github.com/material-components/material-components-android/issues/2766
Resolves https://github.com/material-components/material-components-android/pull/2769

GIT_ORIGIN_REV_ID=9e60355679855b57ab63edf63944d3e23d2aec9a
PiperOrigin-RevId: 458516880
2022-07-06 05:03:16 -07:00
Material Design Team
c49f9615a8 Automated g4 rollback of changelist 458476376
PiperOrigin-RevId: 458490930
2022-07-06 05:02:20 -07:00
raajkumars
2d83321a91 [Icon Buttons] Added support for toggleable Icon buttons.
PiperOrigin-RevId: 458476376
2022-07-06 05:00:00 -07:00
pekingme
5ff3930833 [FAB][Cleanup] Reorder styles.
PiperOrigin-RevId: 458305149
2022-07-06 04:57:47 -07:00
pekingme
04f4a1abc0 [ProgressIndicator] Renamed res/animator to res/anim.
PiperOrigin-RevId: 458269849
2022-07-06 04:56:28 -07:00
Manuel Mato
03c4353937 [MaterialDividerItemDecoration] When lastItemDecorated false then creates a blink with the last view contains a dropdown from visible to gone
Resolves https://github.com/material-components/material-components-android/issues/2771
Resolves https://github.com/material-components/material-components-android/pull/2782

GIT_ORIGIN_REV_ID=8f60bab8cbdcfd1db3b7ced1a508d0ac0cde0197
PiperOrigin-RevId: 458265064
2022-07-06 04:55:00 -07:00
pekingme
65a3ac555a Automated g4 rollback of changelist 457648699
PiperOrigin-RevId: 458256849
2022-07-06 04:53:45 -07:00
pubiqq
4dc3d93ac2 [NavigationView] Update foreground boundaries of menu items when setting a new foreground
Resolves https://github.com/material-components/material-components-android/pull/2737
Resolves https://github.com/material-components/material-components-android/issues/2735

GIT_ORIGIN_REV_ID=8632d22d414f592378b68a8d27f7fba73edc28f9
PiperOrigin-RevId: 458198734
2022-07-06 04:52:55 -07:00
pubiqq
1dc0e6b490 [MaterialTimePicker] Fix AM/PM toggle
Before the CL we set AM/PM selection in the listeners no matter the target view (AM/PM) is being checked or being unchecked. So the order of calling listeners of AM and PM can "revert" the selection, if the callback for being unchecked is called later.

This logic is apparently wrong - we should select AM/PM when they are being unchecked anyways.

Resolves https://github.com/material-components/material-components-android/pull/2791
Resolves https://github.com/material-components/material-components-android/issues/2788

GIT_ORIGIN_REV_ID=018e053394f44d6334827fc3f95406c2937ae582
PiperOrigin-RevId: 458027987
2022-07-06 04:51:59 -07:00
AshutoshSundresh
cd80b71817 [Resources] Remove unused public.xml resources
Resolves https://github.com/material-components/material-components-android/pull/2761

GIT_ORIGIN_REV_ID=fbc80605591c097ab56f4a8f0c9b4a2a3cbcfe10
PiperOrigin-RevId: 457959343
2022-06-29 14:39:28 +00:00
conradchen
ac7b761294 [BottomSheet] Create a drag handle view which support accessibility control
PiperOrigin-RevId: 457939228
2022-06-29 14:38:43 +00:00
conradchen
ca2da6c6a4 Automated g4 rollback of changelist 454163860
PiperOrigin-RevId: 457744460
2022-06-29 14:36:58 +00:00
Material Design Team
7e9045b8b7 Automated g4 rollback of changelist 457576897
PiperOrigin-RevId: 457648699
2022-06-29 13:40:35 +00:00
pekingme
ac5c4df3ae [Tokens][FAB] Integrate component tokens.
PiperOrigin-RevId: 457576897
2022-06-27 23:30:10 +00:00
rightnao
f2f588af82 [BottomAppBar] Token integration
PiperOrigin-RevId: 457554326
2022-06-27 17:26:37 -04:00
pekingme
cc317e15d7 [Tokens] Included parent display group names in the output file comments.
PiperOrigin-RevId: 457503467
2022-06-27 17:25:31 -04:00
conradchen
36efca0aa2 [Tab] Refine tab update logic from ViewPager adapters
Refines the logic so only the affected tabs will be updated.

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

PiperOrigin-RevId: 457501629
2022-06-27 20:09:36 +00:00
rightnao
f2423de558 [BottomAppBar] Add attribute to remove embedded FAB elevation
PiperOrigin-RevId: 457084450
2022-06-27 20:08:08 +00:00
pekingme
cd37b9170c [Tokens] Updated formatter to add an new line between token_set sections for better readability.
PiperOrigin-RevId: 457063206
2022-06-24 20:25:49 +00:00
rightnao
88a73ebb8e [BottomAppBar] Add fab end margin attribute
PiperOrigin-RevId: 456907281
2022-06-24 20:25:00 +00:00
rightnao
397e48f279 [BottomAppBar] Add menu alignment attribute
PiperOrigin-RevId: 456848323
2022-06-24 20:23:47 +00:00
pekingme
d320d4866b [Tokens] Integrated elevation overlay color.
PiperOrigin-RevId: 456827685
2022-06-24 20:22:35 +00:00
pekingme
4188995b11 [Tokens][BottomAppBar] Generated resources from tokens.
PiperOrigin-RevId: 456827093
2022-06-24 20:20:47 +00:00
pekingme
2fc2e6a167 [Tab] Fixed indicator not updating when a tab to the start/left of the selected tab is removed.
PiperOrigin-RevId: 456322731
2022-06-23 18:34:24 +00:00
rightnao
cab45dd1df [BottomAppBar] Add new anchor mode attribute for FAB that has an embedded option
PiperOrigin-RevId: 455660518
2022-06-23 18:33:35 +00:00
dsn5ft
241aa5cd8b [CollapsingToolbarLayout] Added experimental API to allow generic customizations of the StaticLayout.Builder used for the title text
Example usage:

```
collapsingToolbarLayout.setStaticLayoutBuilderConfigurer(
    builder ->
        builder.setLineBreakConfig(
            new LineBreakConfig.Builder()
                .setLineBreakWordStyle(LineBreakConfig.LINE_BREAK_WORD_STYLE_PHRASE)
                .build()));
```

PiperOrigin-RevId: 455625977
2022-06-23 18:32:33 +00:00
pekingme
3fdfb6e230 [I18n] Updated translated strings. We know how to say "Cancel" now :)
PiperOrigin-RevId: 454915686
2022-06-14 12:36:12 -07:00
pekingme
ecb6284a8b [Shape] Fixed overlapping of compat shadow of inner corners.
Resolves https://github.com/material-components/material-components-android/issues/1388

PiperOrigin-RevId: 454893622
2022-06-14 10:21:03 -07:00
conradchen
fd5ee4a989 [Snackbar] Avoid update layout if bottom margins for anchor view does not change
Whenever the anchor view is being relaid out, we will try to update the bottom margin of the snack bar, which may cause the anchor view be relaid out again, thus an infinite loop. Avoids updating margins if the bottom margin for anchor view doesn't change to fix the issue.

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

PiperOrigin-RevId: 454885847
2022-06-14 10:19:33 -07:00
conradchen
051410b7ef [TextField] Stop saving/restoring TextInputLayout's themeable fields
Saving/restoring themeable fields will cause problems when the view is recreated, because those fields will be restored to the value resolved from the context before the recreation, instead of the current context. For example, when the device locale changes, those fields will still be restored to the previous locale instead of the new one.

It's a general practice in Android framework and AndroidX not to save/restore themeable fields. If clients need this, they should implement their own logic.

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

PiperOrigin-RevId: 454708278
2022-06-13 16:15:10 -07:00
conradchen
687e73590d [TopAppBar] Exclude gone views from scroll range calculation
Resolves https://github.com/material-components/material-components-android/issues/2709

PiperOrigin-RevId: 454163860
2022-06-10 16:38:51 -07:00
leticiars
254abc58b8 [RadioButton] Refactored button tint color resource and updated docs
PiperOrigin-RevId: 453664804
2022-06-09 13:41:56 -07:00
rightnao
a601107868 [MaterialButton] Add methods to not toggle checked state on buttons on click
Resolves https://github.com/material-components/material-components-android/issues/2291

PiperOrigin-RevId: 453569861
2022-06-07 18:53:01 -07:00
leticiars
8dd9c7e30c [Checkbox] Added support for error state.
PiperOrigin-RevId: 453496914
2022-06-07 18:52:10 -07:00
hunterstich
5c0003ca81 [ExtendedFloatingActionButton] Updated show and hide motion specs to use motion tokens.
Resolves https://github.com/material-components/material-components-android/issues/2086

PiperOrigin-RevId: 453457969
2022-06-07 18:51:11 -07:00
hunterstich
11578b34f3 [NavigationBar][NavigationRail] Updated item ripple to be contained within active indicator shape when enabled.
PiperOrigin-RevId: 453449225
2022-06-07 18:49:19 -07:00
dsn5ft
c5b37e6ea6 [MaterialToolbar] Add clearNavigationIconTint() method
Resolves https://github.com/material-components/material-components-android/issues/2678

PiperOrigin-RevId: 453220817
2022-06-06 14:25:49 -07:00
pekingme
25482b1425 [FAB] Migrated "regular/default" sized styles to new shape system.
PiperOrigin-RevId: 452817382
2022-06-03 15:49:33 -07:00
conradchen
1fe1618fca [BottomSheet] Do not find scrolling child that's not visible
Resolves https://github.com/material-components/material-components-android/issues/1834

PiperOrigin-RevId: 452813746
2022-06-03 15:42:29 -04:00
conradchen
71bfaca706 [ProgressIndicator] Fix ProgressIndicator's size under a complex measurement
When a ProgressIndicator doesn't have a preferred width or height, its size will be calculated incorrectly as we rely on its super class, ProgressBar's onMeasure() method to decide its size. But ProgressBar doesn't support "unspecified" preferred width/height, in this case it will set measured dimensions to fixed values based on the incorrect "preferred size".

Fixes this issue by fallback to the default View.onMeasure() logic when no preferred width or height is specified.

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

PiperOrigin-RevId: 452795304
2022-06-03 12:10:03 -07:00
Sujit Kumar
ed11e694e7 [Slider] Fix label visibility when slider is hidden
Resolves https://github.com/material-components/material-components-android/pull/2730
Resolves https://github.com/material-components/material-components-android/issues/2726

GIT_ORIGIN_REV_ID=40d8798531f9a4ec82465909c8ec9b83d0201371
PiperOrigin-RevId: 452791189
2022-06-03 12:09:21 -07:00
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