221 Commits

Author SHA1 Message Date
connieshi
bf33b9e4e7 Override onInitializeAccessibilityNodeInfo to explicitly tell the AccessibilityInfoNode whether a chip is checkable or clickable.
Avoid setting custom ExploreByTouchHelper as delegate in pre-N unless there's a close/trailing icon. This is necessary to workaround a Talkback bug.

PiperOrigin-RevId: 211490101
2018-09-07 11:49:26 -04:00
cketcham
7528288743 Fix BottomAppBar animation bug where calling replaceMenu() will cancel a currently running animation
PiperOrigin-RevId: 211449657
2018-09-07 11:36:50 -04:00
cketcham
664a0a9100 Update FabTransformationBehavior to transform the FloatingActionButton
Rather than just setting the FloatingActionButton to be invisible, we should actually perform the translation transformation on it. This is necessary to allow for other views which may be watching for transformations (such as the BAB) to update.

PiperOrigin-RevId: 211080287
2018-08-31 11:13:50 -04:00
cketcham
d6e4991e78 Fix default FAB animation for BottomAppBar
PiperOrigin-RevId: 210920372
2018-08-31 11:13:24 -04:00
marianomartin
e0e7c51991 BottomAppBar change interpolation to be 0 if fab is not visible
PiperOrigin-RevId: 210912015
2018-08-31 11:13:05 -04:00
afohrman
1335815927 Fix MaterialShapeDrawable's handling of tint.
Before this change, MaterialShapeDrawable incorrectly handled ColorStateLists. Only the color defined "last" in a ColorStateList was used. This is because MaterialShapeDrawable was not properly updating and handling state changes. This change fixes the issue by updating the tint filter appropriately and overriding some methods which should have been overridden.

PiperOrigin-RevId: 210779870
2018-08-31 11:12:24 -04:00
marianomartin
0c78325131 Automated g4 rollback of changelist 210712811
PiperOrigin-RevId: 210768027
2018-08-31 11:12:09 -04:00
marianomartin
8441bb689d Fix BottomAppBar background on Kitkat
PiperOrigin-RevId: 210763753
2018-08-31 11:11:45 -04:00
cketcham
f2aba00d8a Set maxButtonHeight for BottomAppBar to avoid alignment issues
PiperOrigin-RevId: 210763592
2018-08-31 11:11:26 -04:00
connieshi
bca3dad666 Add surface layer to ChipDrawable.
PiperOrigin-RevId: 210727850
2018-08-31 11:11:01 -04:00
afohrman
49dc5f4e7c Make MaterialShapeDrawable respect to InsetDrawables.
Before this change, MaterialShapeDrawable did not draw with respect to InsetDrawables. The problem was that MaterialShapeDrawable was using the Canvas to determine where to draw, rather than the bounds. This change reworks MaterialShapeDrawable to use the bounds to calculate and draw the shape's path, rather than the Canvas.

PiperOrigin-RevId: 210724227
2018-08-29 11:33:35 -04:00
marianomartin
72eaab9ff2 TextInputLayout: setBoxCornerRadiiResources param mismatch
PiperOrigin-RevId: 210719217
2018-08-29 11:32:56 -04:00
marianomartin
3758c170c3 MaterialCardView update foreground drawables instead of creating new ones.
PiperOrigin-RevId: 210712811
2018-08-29 11:32:17 -04:00
dniz
6a1d85f08c Action Bar typography styling
PiperOrigin-RevId: 210604964
2018-08-29 11:31:51 -04:00
gauthams
74aaace931 Update legacy TabLayout style to set tabTextColor to @null, so that it uses textColor from tabTextAppearance.
PiperOrigin-RevId: 210592264
2018-08-28 16:45:27 -04:00
Material Design Team
56ee534de2 Creates and colors SwitchMaterial
PiperOrigin-RevId: 210574240
2018-08-28 16:44:02 -04:00
Material Design Team
b0a9ff6658 Add an override to setLayoutDirection from the parent text view of chips.
Setting layoutDirection on TextViews to the direction of the View locale is necessary to ensure that text on chips is rendered correctly in RTL mode. Previously, it would default to LTR mode and then not get set with proper paddings until you interact with a chip to invalidate the layout.

Before (RTL): https://surbhimadan.users.x20web.corp.google.com/www/textrtl_before.mp4
After (RTL): https://surbhimadan.users.x20web.corp.google.com/www/textrtl_after.mp4
Verified no changes to LTR.

PiperOrigin-RevId: 210560864
2018-08-28 16:43:46 -04:00
dniz
919f2183f2 Change Snackbar to use margin instead of padding for window inset positioning
PiperOrigin-RevId: 210554683
2018-08-28 16:43:13 -04:00
gauthams
14e9a020a1 Update TabLayout to use new color attributes
PiperOrigin-RevId: 210553777
2018-08-28 16:42:54 -04:00
marianomartin
1536adecf2 Fix color subsystem for Bottom Navigation
PiperOrigin-RevId: 210544385
2018-08-28 16:42:21 -04:00
gauthams
cfbc6bb50b Reuse color resources rather than having attribute dependency in MDC Bridge themes
PiperOrigin-RevId: 210438272
2018-08-28 16:41:54 -04:00
cketcham
abee218646 Fix height of BottomAppBar in landscape
BottomAppBar was incorrectly using the Toolbar min height which is less tall in landscape. It should always be 56dp.

PiperOrigin-RevId: 210362480
2018-08-28 16:41:25 -04:00
dniz
498d200f40 Fix Toolbar & ActionBar sizes for large screens
PiperOrigin-RevId: 210361782
2018-08-28 16:41:06 -04:00
connieshi
250a906620 Fix bug that ignored ripple colors set programmatically if device is running Api 21+ and framework ripple is used.
Update chip demo in catalog to have ripple color corresponding to the current theme's primary color.

PiperOrigin-RevId: 210142873
2018-08-28 16:40:45 -04:00
cketcham
71f5ea1415 Add alternate animations for BottomAppBar mode changes
PiperOrigin-RevId: 210096177
2018-08-28 16:40:25 -04:00
Material Design Team
a5c1ea2709 Fixes Chip text padding & drawing.
The previous code was setting total padding (both start & end) as just end padding of the parent TextView and relying on the invalidation phase drawing the text in the correct place by shifting canvas with computed offset of start padding. This is risky as Chip may be just re-laid without actually invalidating it and render wrong paddings. Also RTL layout direction is incorrectly identified as LTR during layout sometimes, which makes the text being rendered with incorrect offset.

This change sets the paddings correctly removing the need of manual offsetting during onDraw() and relies purely on TextView for its text rendering.

PiperOrigin-RevId: 210042249
2018-08-28 16:40:05 -04:00
cketcham
7b564d1d52 Update default animation spec for BottomSheetDialogs
PiperOrigin-RevId: 209996117
2018-08-28 16:38:35 -04:00
cketcham
9820f85843 Fix bug caused by not resetting imageMatrixScale in FloatingActionButton
PiperOrigin-RevId: 209995243
2018-08-28 16:38:12 -04:00
cketcham
18be1b73af Modify BottomAppBar to react to the transformations of the FloatingActionButton
PiperOrigin-RevId: 209988651
2018-08-28 16:37:42 -04:00
Holger Schmidt
2b8952d8e8 Stop ignoring bottomPadding and rightPadding set on ChipGroup.
Resolves https://github.com/material-components/material-components-android/pull/186

Resolves #186

PiperOrigin-RevId: 209962412
2018-08-28 16:36:23 -04:00
connieshi
1f98c64b66 Remove redundant call to onSizeChange() in ChipDrawable#setTextAppearance(). Always evoke callback in TextAppearance#getFontAsync
Switch to using TextUtils.equals for more robust string comparison.

PiperOrigin-RevId: 209764943
2018-08-28 16:36:00 -04:00
marianomartin
585e2fede0 Remove constructor comments
PiperOrigin-RevId: 209762154
2018-08-28 16:34:43 -04:00
Material Design Team
7a2b5f0cd7 Automated g4 rollback of changelist 209640439
PiperOrigin-RevId: 209705959
2018-08-28 16:34:03 -04:00
cketcham
148ca998fe Modify BottomAppBar to react to the transformations of the FloatingActionButton
PiperOrigin-RevId: 209640439
2018-08-28 16:33:22 -04:00
Material Design Team
e8c6a84246 Create the material CheckBox component with a catalog demo.
PiperOrigin-RevId: 209638198
2018-08-28 16:32:59 -04:00
gauthams
460c226fdf Fix bug in TabLayout where TabViews initialized to unselected would not have unselected state.
Essentially, the issue is that when "selected" tabs were added to a TabLayout, we were calling tab.select() which updated the state of the selected tab to selected, and sets all other tabs to unselected. HOWEVER, when an "unselected" tab is added, we never call tab.select(), so the unselected tab's state never gets updated until a tab is clicked manually. The default state of tabs is "selected", so unselected tabs appeared selected.

PiperOrigin-RevId: 209622793
2018-08-28 16:32:34 -04:00
gauthams
15bf27d7cd Update MaterialButton to use new color attributes
PiperOrigin-RevId: 209617286
2018-08-28 16:31:53 -04:00
afohrman
a239a14139 Use null check instead of instanceOf for boxBackground's GradientDrawable initialization.
PiperOrigin-RevId: 209596322
2018-08-28 16:31:27 -04:00
gauthams
65e33f20af Clarify documentation for TabLayout's GRAVITY_FILL behavior to specify that it does not take effect on screens wider than 600dp.
PiperOrigin-RevId: 209524721
2018-08-28 16:30:27 -04:00
marianomartin
7e3ec00320 Fix broken gradle build because of duplicated attr
PiperOrigin-RevId: 209415765
2018-08-20 11:33:06 -04:00
cketcham
f9ca2463fd Clarify Roboto medium TextAppearance styles
Roboto Medium is only available after api 21, before that the font falls back to regular bold roboto

PiperOrigin-RevId: 209197782
2018-08-17 17:32:49 -04:00
marianomartin
4b73cb095e MaterialCardView API 16 ripple
PiperOrigin-RevId: 209182404
2018-08-17 17:30:29 -04:00
marianomartin
7020b37719 Set background transparent foreground on cardview
PiperOrigin-RevId: 209152296
2018-08-17 17:28:29 -04:00
Material Design Team
b65d0e3e57 TextAppearance typeface bug fix & refactoring of getFontAsync().
This is in preparation of larger change of moving CollapsingTextHelper onto TextAppearance to fix related bugs & avoid code duplication.

1. Introduces a version of getFontAsync() in TextAppearance that doesn't require TextPaint as an argument.
2. Refactors the existing getFontAsync to wrap the new implementation.
3. Fixes a bug - TextAppearance would not apply the correct typeface from a style when fontFamily was not present in the style def.

PiperOrigin-RevId: 209147825
2018-08-17 17:20:54 -04:00
marianomartin
08c729d218 Fix icon tinting not working prep L
PiperOrigin-RevId: 209068353
2018-08-17 17:19:37 -04:00
marianomartin
92e34f6830 MaterialCardView keeps shrinking its inner content when changing its strokeWidth
PiperOrigin-RevId: 209028205
2018-08-17 17:18:31 -04:00
marianomartin
09673a5de7 MaterialCardView add ripple drawable to foreground
PiperOrigin-RevId: 208993686
2018-08-17 17:15:51 -04:00
cketcham
43bdfac37b Expose option to slide the BottomAppBar on and off the screen programmatically
PiperOrigin-RevId: 208866469
2018-08-17 17:14:22 -04:00
connieshi
0ced1bcf8c Return early from Chip#setupTouchTargetDelegate If the client didn't specify touchTargetDelegate attribute in xml.
PiperOrigin-RevId: 208717708
2018-08-17 17:13:05 -04:00
connieshi
36a472b22a ChipGroup's layout should include the rightmost child's end margin.
PiperOrigin-RevId: 208515835
2018-08-17 17:12:12 -04:00