367 Commits

Author SHA1 Message Date
connieshi
4eb0f121a9 Add build.gradle dependency on shapes to the floating action button module.
PiperOrigin-RevId: 221796687
2018-11-16 12:22:57 -05:00
afohrman
16c6daa9ea Update counter content description every time the counter is updated.
Also clarify the counter description when the limit is not exceeded. Instead of "3/10" it now reads "Characters entered 3 of 10."

Before this change, the counter would read out incorrect character lengths when focused on -- since the live region was set to ACCESSIBILITY_LIVE_REGION_POLITE, it wouldn't be incorrectly read out to the user unless they explored by touch, but if the user were to tap the counter view, it would read out an incorrect character length. This commit fixes that by updating the counter description at the appropriate point when the character count is updated.

PiperOrigin-RevId: 221671905
2018-11-16 12:20:03 -05:00
connieshi
9fd32f61c3 Log warning instead of UnsupportedOperationException when chip#setBackground and related methods are called.
PiperOrigin-RevId: 221665841
2018-11-16 12:18:15 -05:00
cketcham
88c804ea91 Fix shadow for BottomAppBar so it looks more natural
PiperOrigin-RevId: 221534701
2018-11-16 11:58:31 -05:00
marianomartin
123b9f3e70 Material button icon gravity doesn't respond to text changes.
PiperOrigin-RevId: 221480745
2018-11-16 11:56:23 -05:00
isabellekim
cea8fab635 Update card corner radius to 4dp to match spec.
PiperOrigin-RevId: 221346774
2018-11-16 11:49:05 -05:00
isabellekim
7e3cd20408 Stop setting minimum height and width on MaterialCardView's contentLayout. Since it's added with MATCH_PARENT, it will adjust according to MaterialCardView's minimum height and width, which will match CardView's behavior.
PiperOrigin-RevId: 221323749
2018-11-16 11:48:15 -05:00
connieshi
3cc29997ec Removed unused touch target helper classes.
PiperOrigin-RevId: 221318504
2018-11-16 11:37:01 -05:00
isabellekim
de6c9a071d Support materialThemeOverlay for SwitchMaterial.
PiperOrigin-RevId: 221317700
2018-11-16 11:35:00 -05:00
isabellekim
7084feab9f Support materialThemeOverlay for RadioButton.
PiperOrigin-RevId: 221315243
2018-11-16 11:33:55 -05:00
isabellekim
ef2c32cf15 Support materialThemeOverlay for checkboxes.
PiperOrigin-RevId: 221313392
2018-11-16 11:30:34 -05:00
connieshi
2e053c64d6 Fix typo.
PiperOrigin-RevId: 221259543
2018-11-16 11:29:32 -05:00
connieshi
c13949593f Add getter/setter for custom chip attribute "ensureMinTouchTargetSize".
PiperOrigin-RevId: 221145735
2018-11-16 11:28:10 -05:00
dniz
0bef80a76b Update colors for DayNight themes
PiperOrigin-RevId: 221137528
2018-11-16 11:26:51 -05:00
cketcham
ab61f4c50a Restrict access to setting the vertical offset for the shadow.
I think we may want to remove these methods in the future and just handle this automatically.

PiperOrigin-RevId: 220944239
2018-11-16 11:19:10 -05:00
leticiars
ea44a6fc85 Fixing MDC filled background text field for hovered and disabled states.
PiperOrigin-RevId: 220843896
2018-11-16 11:12:58 -05:00
marianomartin
2fdb73de6e Override setVisibility so it's not restricted
PiperOrigin-RevId: 220838067
2018-11-16 11:11:52 -05:00
marianomartin
47fc285f6f Support shape theming in FAB Api 19 and lower
PiperOrigin-RevId: 220806554
2018-11-16 11:10:42 -05:00
isabellekim
3bc3cc9cbf Stop modifying the DEFAULT_CORNER_TREATMENT in ShapeAppearanceModel.
PiperOrigin-RevId: 220688536
2018-11-16 11:06:53 -05:00
connieshi
60d1dfac70 Update chipDrawable to be wrapped by InsetDrawable (if needed) to ensure it meets Android's recommended minimum touch target size.
Update demo catalog app.

PiperOrigin-RevId: 220370443
2018-11-16 10:57:34 -05:00
isabellekim
26109ae837 Update MaterialCardView to use MaterialShapeDrawable, changing stroke to respect extra padding that CardView adds for shadows.
Also adds clickable Card to the catalog

PiperOrigin-RevId: 220343650
2018-11-16 10:53:15 -05:00
marianomartin
215bb6e294 Increase touch target of fab to min 48dp
PiperOrigin-RevId: 220311577
2018-11-16 10:51:48 -05:00
connieshi
c48d882994 Add javadoc to ChipDrawable's getters and setters.
PiperOrigin-RevId: 220301488
2018-11-16 10:51:06 -05:00
connieshi
a9b6225c08 Add build.gradle dependency on shapes to the Chip module.
PiperOrigin-RevId: 220168626
2018-11-16 10:40:37 -05:00
marianomartin
e94e2d35fe Support shape theming in fab
PiperOrigin-RevId: 219812144
2018-11-16 10:38:43 -05:00
connieshi
f219705bb6 Add javadoc to chip getters and setters.
PiperOrigin-RevId: 219793479
2018-11-16 10:37:15 -05:00
afohrman
ff9dded7ba Use typescale for TextInputLayout.
Update the type within TextInputLayout create color attributes for each element in order to ensure that the colors can be set outside of our typescale. The colors set in those new attributes are intended to be visual no-ops; the goal of this change is not to update the colors.

PiperOrigin-RevId: 219726813
2018-11-16 10:35:41 -05:00
isabellekim
2997b6995f Add shadow compat support for cut corners and triangle edge treatments, updating ShapePath to add extra shadow arcs when needed:
+ Updates LineShadowOperation to call drawEdgeShadow with a horizontal edge
+ ShapePath has a start & end shadow angle and will add shadow arcs to fill in gaps between shadow operations

PiperOrigin-RevId: 219686107
2018-11-01 16:22:14 -07:00
isabellekim
b07fdf2459 Remove anti-aliasing from cornerShadowPaint (to allow corner shadows to line up with edge shadows along angles)
PiperOrigin-RevId: 219575570
2018-11-01 16:20:43 -07:00
leticiars
7eac68f306 Adding surface layer support to MDC text fields.
PiperOrigin-RevId: 219499276
2018-11-01 16:19:29 -07:00
cketcham
3d8e2b408c Stop expanding the clip rect on versions of android that have native shadow support
PiperOrigin-RevId: 219478262
2018-11-01 16:17:19 -07:00
connieshi
b888d9620b Support shape theming in Chip component.
PiperOrigin-RevId: 219373344
2018-11-01 16:16:14 -07:00
isabellekim
e9a8d48f60 Fixes MaterialShadowDrawable shadow to respect bounds that don't start at (0,0)
PiperOrigin-RevId: 219367777
2018-11-01 16:15:40 -07:00
cketcham
22cd4dba4f Prevent invalidating MaterialShapeDrawable if parameters haven't changed
PiperOrigin-RevId: 219319784
2018-11-01 16:13:36 -07:00
afohrman
a25e13ca39 Update isStateful() method in MaterialShapeDrawable.
isStateful() should include the statefulness of the fill and stroke colors.

PiperOrigin-RevId: 219310584
2018-11-01 16:11:35 -07:00
marianomartin
85bec581d7 Add a constructor that takesdefault cornersize in ShapeAppearanceModel
PiperOrigin-RevId: 219308037
2018-11-01 16:11:12 -07:00
afohrman
ed37888efe Remove MaterialShapeDrawable hairline inset from fill bounds.
PiperOrigin-RevId: 219303758
2018-11-01 16:09:21 -07:00
connieshi
d9d9b6e1ef Change scope of #getFillBounds to protected so children can override it.
PiperOrigin-RevId: 219227988
2018-11-01 16:08:38 -07:00
connieshi
0f764e9a15 Change scope of #getBoundsAsRectF and #drawShape to be protected so the children of MSD could call them.
PiperOrigin-RevId: 219189920
2018-11-01 16:08:10 -07:00
dniz
fadcb7fc31 Add a MaterialAttributes#resolveAttribute method that doesn't throw, a
MaterialColors#getColor method that allows for a default value, and a MaterialResources#getColorStateList that accepts a TintTypedArray

PiperOrigin-RevId: 219170329
2018-11-01 16:07:21 -07:00
dniz
3637c23078 Dark theme color palette
PiperOrigin-RevId: 219143246
2018-11-01 16:05:24 -07:00
afohrman
38ef896da2 Adjust corners of MaterialShapeDrawable's stroke to draw the stroke perfectly over the fill.
To draw the stroke with the correct corner radius, MaterialShapeDrawable now calculates what the corner radius should be and adjusts the stroke accordingly.

Before this change, the corner radius was calculated such that the stroke didn't fully reach the edges of the shape. This change tweaks the corner radius calculation so that the stroke's path matches the fill's path and is overlaid directly on top of the fill's shape.

PiperOrigin-RevId: 219139586
2018-11-01 16:04:35 -07:00
cketcham
3bc7afd292 Disable native shadows when compat shadows are always drawn.
PiperOrigin-RevId: 219134990
2018-11-01 16:04:08 -07:00
afohrman
7656db9b1e Update TabLayout and MaterialButtonHelper documentation for LayerDrawable workaround.
PiperOrigin-RevId: 219127481
2018-11-01 16:03:25 -07:00
afohrman
14460ac3dd Add a layering method to blend surface and onSurface colors without an alpha
value.

PiperOrigin-RevId: 218902432
2018-10-28 21:47:59 -04:00
afohrman
52eb143e99 Optimize stroke inset bounds method.
Use RectF#inset() instead of manually insetting the stroke by half of the stroke width.

PiperOrigin-RevId: 218887035
2018-10-28 21:47:13 -04:00
cketcham
560c982284 Enable shadows for BottomAppBar
PiperOrigin-RevId: 218868156
2018-10-28 21:44:27 -04:00
dniz
d03f490740 Snackbar update label text color to new color system
PiperOrigin-RevId: 218861625
2018-10-28 21:42:33 -04:00
cketcham
f6f2f98c66 Read color value as CSL correctly on API 15 and below
PiperOrigin-RevId: 218858216
2018-10-28 21:41:38 -04:00
connieshi
12b56e226a Make ChipSurfaceColor attribute private, remove its public getter/setters.
PiperOrigin-RevId: 218680794
2018-10-28 21:39:27 -04:00