2689 Commits

Author SHA1 Message Date
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
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