562 Commits

Author SHA1 Message Date
ldjesper
bca2bd0e00 Creates a new builder for Alert Dialog's that supports the Material Shape system.
PiperOrigin-RevId: 223985990
2018-12-06 12:03:16 -05:00
cketcham
7a69df4abf Add transition feedback for accessibility when the BottomDrawer opens or closes
PiperOrigin-RevId: 223977494
2018-12-06 12:02:12 -05:00
afohrman
530a7a8f9e Automated g4 rollback of changelist 223552187
PiperOrigin-RevId: 223870917
2018-12-06 11:47:52 -05:00
cketcham
7a2c2823ee Only recalculate the path if it has changed
PiperOrigin-RevId: 223826749
2018-12-06 11:47:06 -05:00
marianomartin
d75fb6513c Fix constant state in MSD
PiperOrigin-RevId: 223802087
2018-12-06 11:46:29 -05:00
afohrman
cf5e35c624 Turn off theme enforcement for ShapeAppearanceModel.
ShapeAppearanceModel doesn't support theme attributes, so it doesn't make sense to check for our theme in the style reference when creating it.

PiperOrigin-RevId: 223796338
2018-12-06 11:46:00 -05:00
Material Design Team
f152b75e1a Automated g4 rollback of changelist 223558824
PiperOrigin-RevId: 223564801
2018-12-06 11:43:02 -05:00
marianomartin
c75482b473 Fix constant state in MSD
PiperOrigin-RevId: 223558824
2018-12-06 11:42:42 -05:00
afohrman
671f785662 Automated g4 rollback of changelist 223530191
PiperOrigin-RevId: 223552187
2018-12-06 11:42:22 -05:00
afohrman
ead212fbff Support shape theming in TextInputLayout.
PiperOrigin-RevId: 223530191
2018-12-06 11:41:19 -05:00
Material Design Team
191bf6c971 Export getActionMenuViewTranslationX() to make subclass be available to customize position of menu view.
PiperOrigin-RevId: 223468200
2018-12-06 11:40:11 -05:00
cketcham
cce3b93a9d Remove binary incompatibility between 27.1.1 and 28.0.0 for TabLayout
PiperOrigin-RevId: 223444074
2018-12-06 11:39:28 -05:00
cketcham
3ad01eceda Ignore empty header and dividers when counting the number of items in NavigationView for accessibility
PiperOrigin-RevId: 223407274
2018-12-06 11:39:08 -05:00
Material Design Team
0ccc9c0f24 Automated g4 rollback of changelist 223388533
PiperOrigin-RevId: 223398975
2018-12-06 11:38:41 -05:00
marianomartin
bf024ebed9 Remove stroke shader from MSD
PiperOrigin-RevId: 223397575
2018-12-06 11:38:24 -05:00
ldjesper
e5ad8ffe43 Creates a new builder for Alert Dialog's that supports the Material Shape system.
PiperOrigin-RevId: 223388533
2018-12-06 11:35:10 -05:00
isabellekim
14f41bd14d Update MaterialButton to use a themed context in order to get attributes defined on the materialThemeOverlay.
PiperOrigin-RevId: 223218118
2018-12-06 11:33:25 -05:00
leticiars
b769bac91a Increasing padding of Dense outlined text field style in order for the minimum touch target to be maintained when the default text appearance gets updated.
PiperOrigin-RevId: 223063198
2018-12-06 11:32:36 -05:00
marianomartin
3bf777db8a Implement Mutate in MaterialShapeDrawable
PiperOrigin-RevId: 223059565
2018-12-06 11:31:50 -05:00
isabellekim
71891af8df Add shape appearance attributes to MaterialCardView. This maintains current behavior of stroke width / content padding.
When content can be clipped to the shape (round rect, Lollipop+), the content will be clipped to the interior of the stroke.

When preventCornerOverlap is true, if the content cannot be clipped, extra padding is added such that the entirety of the content is inside the stroke. Any contentPadding is additional to this padding. In order to keep centered content centered, the same amount of padding is added in each direction when preventCornerOverlap is true.

PiperOrigin-RevId: 223045615
2018-12-06 11:25:27 -05:00
cketcham
95cf55f04b Remove option to use paint shadow
PiperOrigin-RevId: 223017988
2018-12-06 11:25:01 -05:00
ldjesper
831ad7dde7 a11y for selection control touch targets
PiperOrigin-RevId: 222898711
2018-12-06 11:24:17 -05:00
ldjesper
1b5469c742 Allows programmatic changes to useMaterialThemeColors for selection controls
PiperOrigin-RevId: 222847032
2018-12-06 11:22:54 -05:00
isabellekim
ab48110097 Rolling back changes to support shape theming in MaterialCardView.
PiperOrigin-RevId: 222467563
2018-12-06 11:21:22 -05:00
isabellekim
46e18968d7 Add shape theme to MaterialCardView.
When content can be clipped to the shape (round rect, Lollipop+), the content will be clipped to the interior of the stroke.

When preventCornerOverlap is true, if the content cannot be clipped, extra padding is added such that the entirety of the content is inside the stroke. Any contentPadding is additional to this padding. In order to keep centered content centered, the same amount of padding is added in each direction when preventCornerOverlap is true.

PiperOrigin-RevId: 222456398
2018-12-06 11:20:48 -05:00
melaniegoetz
bd2a4484c3 Update tablayout javadocs to refer to the method correctly
PiperOrigin-RevId: 222443665
2018-12-06 11:20:25 -05:00
cketcham
ddda11bd2d Fix slide animation for BottomAppBar
PiperOrigin-RevId: 222437688
2018-12-06 11:19:28 -05:00
afohrman
c6b554555b Use deep copies for CornerTreatment and EdgeTreatment convenience methods in
ShapeAppearanceModel.

Prior to this change, ShapeAppearanceModel#setAllCorners() and
ShapeAppearanceModel#setAllEdges() set all four corners or edges to the same
CornerTreatment or EdgeTreatment. This change creates deep copies for each
corner/edge treatment to avoid bugs caused by silently reusing the mutable
object.

PiperOrigin-RevId: 222413898
2018-12-06 11:19:04 -05:00
afohrman
98d4b148d1 Create deep copies of CornerTreatments and EdgeTreatments in ShapeAppearanceModel's copy constructor.
Implement Cloneable and override Object#clone() to create deep copies of the corner and edge treatments. The Cloneable method is generally discouraged, but this solution appears to be the most effective solution for our use case because:

- CornerTreatment and EdgeTreatment don't contain mutable fields, so using the native Object#clone() should be fine. This allows us to avoid intervening in the clone() method, which is one of the main reasons to avoid using Obect#clone().
- Since we have to maintain binary compatibility with our 1.0.0 stable release, we have very little wiggle room with which to ensure that we have effective copy() methods in each subclass of CornerTreatment and EdgeTreatment.

PiperOrigin-RevId: 222311453
2018-12-06 11:17:48 -05:00
melaniegoetz
f94800f7b0 Add TabLayout labelVisibility getter method
PiperOrigin-RevId: 222301891
2018-12-06 11:17:22 -05:00
connieshi
9b1f8478e5 Remove chipTouchTargetDelegate attribute.
PiperOrigin-RevId: 222298640
2018-12-06 11:16:48 -05:00
afohrman
a10070b6b3 Unify the creation of default CornerTreatments and EdgeTreatments.
Change the default CornerTreatment created in MaterialShapeUtils from CornerTreatment() to RoundedCornerTreatment(0). This matches the default previously created from ShapeAppearanceModel constructors.

This change unifies the defaults created in ShapeAppearanceModel's constructors with the default created by MaterialShapeUtils, by converging the two default corner and edge treatment creation methods into one method in MaterialShapeUtils. That method is then called from MaterialShapeUtils#createCornerTreatment#createCornerTreatment() and ShapeAppearanceModel's constructors.

This change also renames getDefaultCornerTreatment() to createDefaultCornerTreatment() to convey that the method instantiates an object.

PiperOrigin-RevId: 222269551
2018-12-06 11:15:10 -05:00
ldjesper
89b728d53d Translation string for dialog icon
PiperOrigin-RevId: 222240993
2018-12-06 11:14:29 -05:00
dniz
a185866318 Add support for materialThemeOverlay to Snackbar styles
PiperOrigin-RevId: 222090189
2018-12-06 11:12:31 -05:00
dniz
8073c98d60 Update MDC DayNight themes to use regular and -night qualifiers and remove
-night colors

PiperOrigin-RevId: 222079148
2018-11-26 07:57:12 -05:00
dniz
4dc914d737 Add Snackbar backgroundColorOverlayAlpha attribute
PiperOrigin-RevId: 222075167
2018-11-26 07:56:47 -05:00
marianomartin
415e6ea003 Add a cut corners top edge treatment in the BAB demo
PiperOrigin-RevId: 222071849
2018-11-26 07:55:59 -05:00
Brian Attwell
483d34a0f4 Don't rebind/relayout/reinflate any views after clicking a menu item
If none of the check state has changed, let's not update the menu. Background for this diff is at #61. While larger improvements may make sense, this diff is designed to mitigate the most serious issue in a way that doesn't create risk.

Test: used these modified classes inside the Android Uber app and ran a profiler. The problematic 50ms delay caused by this bug was fixed. You can see the before/after traces in https://issuetracker.google.com/issues/73723207.

Resolves https://github.com/material-components/material-components-android/issues/61
Resolves https://github.com/material-components/material-components-android/pull/62

GIT_ORIGIN_REV_ID=f8f8488689be67b8974d29e1c623e1dbe18cfdae
PiperOrigin-RevId: 221799350
2018-11-16 12:23:34 -05:00
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