60 Commits

Author SHA1 Message Date
marianomartin
b9147d4f2d Remove some lint warnings from baseline
PiperOrigin-RevId: 253036361
2019-06-18 13:24:50 -04:00
marianomartin
5a5d311a36 Check more lint warnings, show warnings as errors.
PiperOrigin-RevId: 252822573
2019-06-18 13:20:15 -04:00
marianomartin
455ba2557b Internal cleanup
PiperOrigin-RevId: 249490219
2019-05-24 14:22:06 -04:00
marianomartin
90837ec485 Internal cleanup
PiperOrigin-RevId: 249243403
2019-05-21 12:15:07 -04:00
marianomartin
213f93e842 set RippleColor doesnt update ripples in cards
PiperOrigin-RevId: 246391887
2019-05-03 11:02:47 -04:00
dniz
3fd054086c Add demo for Drag-and-Drop of Material Cards in a List and clear ripple when drag starts
PiperOrigin-RevId: 242474750
2019-04-19 12:53:43 -04:00
afohrman
ad017d9c09 Adjust card widget style.
PiperOrigin-RevId: 240638576
2019-04-05 15:14:55 -04:00
isabellekim
1a1788a0cf Enable elevation overlays in MaterialCardView.
PiperOrigin-RevId: 238537749
2019-03-22 16:13:08 -04:00
marianomartin
8b277edc7c [MaterialCardView] Change strokeColor to be a ColorStateList
PiperOrigin-RevId: 238241769
2019-03-22 16:05:58 -04:00
marianomartin
01874ad4e9 Change setElevation in MSD to use default offset
PiperOrigin-RevId: 236858323
2019-03-08 09:58:58 -05:00
isabellekim
6f965da141 Move content padding to be inside the intermediate FrameLayout in MaterialCardView. This allows clipping to the inside of the stroke as the FrameLayout bounds and the stroke bounds will be the same.
PiperOrigin-RevId: 236646347
2019-03-08 09:55:07 -05:00
gauthams
1deb4cc1db Add state_checkable to MaterialCardView drawable state, if isCheckable()
PiperOrigin-RevId: 236116032
2019-03-08 09:46:49 -05:00
marianomartin
68357af199 [MaterialCardView] Fix clipping logic to inset by stroke
PiperOrigin-RevId: 235979330
2019-03-08 09:40:38 -05:00
marianomartin
7087f8e5d7 Update MaterialCardView javadocs
PiperOrigin-RevId: 235026790
2019-02-24 14:29:55 -05:00
marianomartin
8449d0e7dc Change opacity of dragged state in cards
PiperOrigin-RevId: 234603183
2019-02-24 14:21:10 -05:00
marianomartin
f59949a297 Fix card ripple bug
PiperOrigin-RevId: 233960735
2019-02-24 14:14:49 -05:00
marianomartin
7f45f74302 Combine default card style and checkable style.
PiperOrigin-RevId: 232472062
2019-02-11 11:14:50 -08:00
marianomartin
33e408d67e Card elevation changes
PiperOrigin-RevId: 231993329
2019-02-11 11:09:05 -08:00
isabellekim
c149a75edb Stop adjusting content padding based on stroke width.
It is the responsibility of clients who want content to be inside the
stroke to set their content padding accordingly.

PiperOrigin-RevId: 231815048
2019-02-11 11:07:37 -08:00
isabellekim
6362e720ec Use stroke width to determine whether a stroke should be drawn for
MaterialCardView.

PiperOrigin-RevId: 230713479
2019-01-25 14:01:46 -05:00
marianomartin
20691fec78 Remove long click toggle behavior from MaterialCardView
PiperOrigin-RevId: 230617290
2019-01-25 13:58:17 -05:00
marianomartin
74b2ddfd6e Add checked icon tinting for MaterialCardView
PiperOrigin-RevId: 229429322
2019-01-18 14:15:16 -05:00
marianomartin
0a5d7e2b57 Add workaround to force ripple to redraw on P
PiperOrigin-RevId: 229370645
2019-01-18 14:14:31 -05:00
dniz
11df79f95c Clean up Gradle build shorthands for appcompat/androidx libraries
PiperOrigin-RevId: 229369959
2019-01-18 14:13:26 -05:00
marianomartin
8b7ec0c80e Add check drawable when card is selected.
PiperOrigin-RevId: 228715367
2019-01-10 17:17:34 -05:00
dniz
a4964594a1 Add MaterialShapeDrawable setElevation(float) and deprecate setShadowElevation(int)
PiperOrigin-RevId: 228572421
2019-01-10 17:16:43 -05:00
marianomartin
0c00762410 Resubmit card view ripple changes
PiperOrigin-RevId: 227909348
2019-01-10 16:30:51 -05:00
marianomartin
637e1599ca Automated g4 rollback of changelist 227719145
PiperOrigin-RevId: 227738476
2019-01-10 16:04:39 -05:00
marianomartin
4cbe3b1ad2 Support checkable in card view, add states demo.
Also added a demo showing the different states

PiperOrigin-RevId: 227719145
2019-01-10 16:02:59 -05:00
Material Design Team
56c22ed0f7 Migrate Cardview android support libraries to androidx.
PiperOrigin-RevId: 225886550
2018-12-21 11:13:36 -05:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -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
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
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
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
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
marianomartin
027e10548f Fix color subsystem for MaterialCardView
PiperOrigin-RevId: 213649174
2018-09-28 16:10:13 -04:00
marianomartin
1ddb5f585a MaterialCardView update foreground drawables instead of creating new ones.
PiperOrigin-RevId: 213594729
2018-09-28 14:55:12 -04:00
dniz
35a0839ad6 Add defStyleRes to materialThemeOverlay wrapping
- Fixes materialThemeOverlay case where client is not using our theme or style (e.g., AppCompat + component with no style set)
- Also refactors createThemedContext() to use obtainStyledAttributes with defStyleAttr and defStyleRes instead of getTheme().resolveAttribute()

PiperOrigin-RevId: 213464594
2018-09-28 14:53:34 -04:00
Material Design Team
843b38a132 Automated g4 rollback of changelist 213442351
PiperOrigin-RevId: 213461630
2018-09-28 14:53:18 -04:00
marianomartin
731586fae6 Fix color subsystem for card view
PiperOrigin-RevId: 213442351
2018-09-28 14:52:58 -04:00
cketcham
655b3dc1b0 Add materialThemeOverlay attribute
PiperOrigin-RevId: 212665868
2018-09-14 10:58:21 -04:00
marianomartin
0c78325131 Automated g4 rollback of changelist 210712811
PiperOrigin-RevId: 210768027
2018-08-31 11:12:09 -04:00
marianomartin
3758c170c3 MaterialCardView update foreground drawables instead of creating new ones.
PiperOrigin-RevId: 210712811
2018-08-29 11:32:17 -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
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