301 Commits

Author SHA1 Message Date
dniz
ea40a1d406 Update Toolbar to use new color system
PiperOrigin-RevId: 216770087
2018-10-11 18:31:53 -04:00
Alex Lockwood
0c9094a1eb [AppBarLayout] Update AppBarLayout to use the 3-arg view constructor
Without this fix, it is impossible for developers to properly make proper use of the `defStyleAttr` view constructor argument.

This PR fixes the bug filed here: https://issuetracker.google.com/issues/117316283

Resolves https://github.com/material-components/material-components-android/pull/212

PiperOrigin-RevId: 216750232
2018-10-11 18:31:34 -04:00
marianomartin
169ac3f142 Add ability to set shader on border paint for MSD
PiperOrigin-RevId: 216709276
2018-10-11 18:30:54 -04:00
marianomartin
9e36c150c0 Fix most javadocs errors
PiperOrigin-RevId: 216697274
2018-10-11 18:24:53 -04:00
connieshi
f3a95d09fe Avoid constantly invalidating ChipDrawable when used in standalone mode.
Created TextAppearanceFontCallback (a fork of FontCallback) in order to pass parameter indicating whether font was resolved synchronously.

PiperOrigin-RevId: 216566240
2018-10-11 18:21:33 -04:00
isabellekim
b7c9432cfd Change MaterialCardView's stroke to use the card corner radius as the outer edge of the stroke instead of the center of the stroke. Adding a stroke will no longer change the shape of the card's corner.
PiperOrigin-RevId: 216522762
2018-10-11 18:17:53 -04:00
melaniegoetz
c7ca91c338 Remove TextAppearance.MaterialComponents.Tab
PiperOrigin-RevId: 216426993
2018-10-11 18:17:08 -04:00
Alex Lockwood
1b2bcfcde2 [MaterialButton] Use Layout#getWidth + Paint#measureText to get the right width of the text.
Resolves https://github.com/material-components/material-components-android/pull/211

PiperOrigin-RevId: 216421698
2018-10-11 18:16:49 -04:00
ldjesper
ba7103aad3 Ellipsize long buttons to force one line by default.
PiperOrigin-RevId: 216403566
2018-10-11 18:16:01 -04:00
isabellekim
fdbf02569b Ensures that bottom navigation item background Drawables don't share the same constant state.
PiperOrigin-RevId: 216355891
2018-10-11 18:13:32 -04:00
marianomartin
421518656f Remove constructors comments
PiperOrigin-RevId: 216255346
2018-10-11 18:13:07 -04:00
dniz
342627e8fb Add API to AppBarLayout Behavior to allow for disabling of offsetting
This makes it possible to disable the "scrolling" that happens when a scrolling
child has a height of match_parent but doesn't have enough actual content to
fill the screen (e.g., a RecyclerView with less than a few items). A scrolling
child with a height of wrap_content that doesn't fill the screen will already
not be scrolled/translated by the AppBarLayout Behavior.

PiperOrigin-RevId: 216255315
2018-10-11 18:12:39 -04:00
melaniegoetz
172dd213de Automated g4 rollback of changelist 215959602
PiperOrigin-RevId: 215986589
2018-10-11 18:12:20 -04:00
melaniegoetz
db507b1048 Remove TextAppearance.MaterialComponents.Tab
PiperOrigin-RevId: 215959602
2018-10-11 18:11:17 -04:00
dniz
f16d0e1a8e Add back getPathForSize() method to MaterialShapeDrawable to preserve API
PiperOrigin-RevId: 215956091
2018-10-11 18:06:02 -04:00
marianomartin
b5486196e6 Use theme attributes to update menus style
PiperOrigin-RevId: 215918907
2018-10-11 18:05:28 -04:00
dniz
24a171ab53 Add config method to AppBarLayout to enable overlapping header with scrolling child
PiperOrigin-RevId: 215800888
2018-10-11 18:04:39 -04:00
Material Design Team
de43cd1ecc Fix NPE in SetStateInternal.
PiperOrigin-RevId: 215732122
2018-10-11 18:04:19 -04:00
Material Design Team
d509eb90a6 Automated g4 rollback of changelist 215569147
PiperOrigin-RevId: 215602434
2018-10-11 18:03:54 -04:00
marianomartin
0e7f80b42b Use theme attributes to update menus style
PiperOrigin-RevId: 215569147
2018-10-11 18:00:51 -04:00
connieshi
aa88e62b30 Initialize all corner and edge treatment fields in the class declaration.
Do not call this() in ShapeAppearanceModel's overloaded constructor.

PiperOrigin-RevId: 215433426
2018-10-11 17:57:42 -04:00
Material Design Team
aec9964104 Add extra flag to setPeekHeight that controls whether the sheet animates between the original peek height and the new peek height.
PiperOrigin-RevId: 215428993
2018-10-02 14:58:12 -04:00
connieshi
e7e6c6fbe0 Call the default ShapeAppearanceModel constructor from its overloaded constructor to ensure that all edge and corner treatments are initialized with a default value.
PiperOrigin-RevId: 215398454
2018-10-02 14:57:13 -04:00
marianomartin
1d4882c6ac Use drawable color filter if it has one instead of overriding it
PiperOrigin-RevId: 215398208
2018-10-02 14:56:52 -04:00
ldjesper
4cda2e3879 Add Material Alert Dialog Layout with message text styling
Changes the message text of Alert Dialogs to use the theme style of textAppearenceBody1.

PiperOrigin-RevId: 215388398
2018-10-02 14:56:27 -04:00
marianomartin
7b0cc53898 Fix FloatingActionButton not tinting on kitkat
PiperOrigin-RevId: 215375598
2018-10-02 14:55:47 -04:00
cketcham
e951ecbd1b Add color system support for BottomAppBar
PiperOrigin-RevId: 215374247
2018-10-02 14:54:08 -04:00
cketcham
3de44ca7ac Add shapes theming infrastructure.
Add shapeAppearance and shapeAppearanceOverlay attributes. These attributes combine to support shapes theming. ShapeAppearance is modeled after TextAppearance. A shapeAppearance attribute contains a style reference that is meant to be defined at the theme level. Since changing anything defined in the shapeAppearance would clobber everything else in the ShapeAppearance, the shapeAppearanceOverlay attribute is provided for clients to modify the shapeAppearance.

PiperOrigin-RevId: 215273652
2018-10-02 14:53:40 -04:00
Material Design Team
a681567504 Automated g4 rollback of changelist 215242636
PiperOrigin-RevId: 215260729
2018-10-02 14:52:47 -04:00
cketcham
432b46cc83 Add shapes theming infrastructure.
Add shapeAppearance and shapeAppearanceOverlay attributes. These attributes combine to support shapes theming. ShapeAppearance is modeled after TextAppearance. A shapeAppearance attribute contains a style reference that is meant to be defined at the theme level. Since changing anything defined in the shapeAppearance would clobber everything else in the ShapeAppearance, the shapeAppearanceOverlay attribute is provided for clients to modify the shapeAppearance.

PiperOrigin-RevId: 215242636
2018-10-02 14:21:40 -04:00
Material Design Team
493c090a88 Set a default contentDescription on TextInputLayout's character counter unless it is overflowed.
PiperOrigin-RevId: 215026891
2018-10-01 12:24:49 -04:00
connieshi
b698c972cb Add MDC bridge theme target that does not include all of material components as a transitive dependency.
PiperOrigin-RevId: 214995615
2018-10-01 12:24:09 -04:00
ldjesper
9cbfddc61b Add attributes to disable Material Theme Colors for Selection Controls
These attributes are necessary for custom drawables.

PiperOrigin-RevId: 214969700
2018-09-28 17:03:18 -04:00
cketcham
8bd94e9276 Rename ShapePathModel to ShapeAppearanceModel.
This commit renames ShapePathModel to ShapeAppearanceModel to align with the new shapeAppearance attributes that will be added for shape theming.

PiperOrigin-RevId: 214818189
2018-09-28 16:30:13 -04:00
cketcham
575d1cb48f Update EdgeTreatment docs
PiperOrigin-RevId: 214647748
2018-09-28 16:29:56 -04:00
cketcham
c6a08a4b68 Allow for centering on EdgeTreatments
PiperOrigin-RevId: 214613004
2018-09-28 16:28:45 -04:00
cketcham
0527fe7d09 Fix MaterialShapeDrawable path so it is correctly convex on API 21 and 22
PiperOrigin-RevId: 214461440
2018-09-28 16:28:01 -04:00
melaniegoetz
24c40ffa2a Fix NPE in BottomSheetBehaviour
PiperOrigin-RevId: 214297001
2018-09-28 16:27:08 -04:00
dniz
868e80ed6f Add support for anchoring Snackbars to Views so they can be placed above
navigational elements and FABs

This commit also disables the pushing up of FABs when an anchor view is set

PiperOrigin-RevId: 214287486
2018-09-28 16:24:01 -04:00
dniz
e853c84767 Fix AppBarLayout liftOnScroll target view caching
PiperOrigin-RevId: 214066255
2018-09-28 16:19:17 -04:00
dniz
e48d3d73a6 Add Snackbar animationMode attr to public values
PiperOrigin-RevId: 214048648
2018-09-28 16:18:58 -04:00
melaniegoetz
4bca4ec9e2 set mtrl_fab_ripple_color to use colorOnSecondary rather than color:white
PiperOrigin-RevId: 214028313
2018-09-28 16:15:46 -04:00
connieshi
fee1efe5c0 Migrate ChipDrawable to inherit from MaterialShapeDrawable instead of Drawable.
PiperOrigin-RevId: 213991051
2018-09-28 16:15:10 -04:00
ldjesper
5df0d8b760 Fix draw bounds for MaterialShapeDrawable stroke and fill
PiperOrigin-RevId: 213877586
2018-09-28 16:12:57 -04:00
ldjesper
03edbf3d5f Switch MaterialShapeDrawable to RectF
PiperOrigin-RevId: 213872653
2018-09-28 16:12:36 -04:00
dniz
8064a7672f New enter and exit animations for Snackbars
- Original slide animation will be used for Widget.Design and unstyled Snackbars
- New fade + scale animation will be used for Widget.MaterialComponents Snackbars

PiperOrigin-RevId: 213669605
2018-09-28 16:10:27 -04:00
marianomartin
027e10548f Fix color subsystem for MaterialCardView
PiperOrigin-RevId: 213649174
2018-09-28 16:10:13 -04:00
dniz
a313443f9e Update AppBarLayout liftOnScroll to support nested scrolling targets
- Add liftOnScrollTargetViewId attribute to allow client to specify the scrolling view that should be listened to for updating AppBarLayout lifted state.
- Use View#canScrollVertically instead of View#getScrollY to determine lifted state.

PiperOrigin-RevId: 213614055
2018-09-28 14:55:37 -04:00
marianomartin
1ddb5f585a MaterialCardView update foreground drawables instead of creating new ones.
PiperOrigin-RevId: 213594729
2018-09-28 14:55:12 -04:00
melaniegoetz
69eebe785f TabLayout functionality to set label visibility
PiperOrigin-RevId: 213554775
2018-09-28 14:54:44 -04:00