31 Commits

Author SHA1 Message Date
marianomartin
8b277edc7c [MaterialCardView] Change strokeColor to be a ColorStateList
PiperOrigin-RevId: 238241769
2019-03-22 16:05:58 -04: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
7087f8e5d7 Update MaterialCardView javadocs
PiperOrigin-RevId: 235026790
2019-02-24 14:29:55 -05:00
marianomartin
33e408d67e Card elevation changes
PiperOrigin-RevId: 231993329
2019-02-11 11:09:05 -08: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
marianomartin
8b7ec0c80e Add check drawable when card is selected.
PiperOrigin-RevId: 228715367
2019-01-10 17:17:34 -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
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
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
cketcham
655b3dc1b0 Add materialThemeOverlay attribute
PiperOrigin-RevId: 212665868
2018-09-14 10:58:21 -04:00
marianomartin
09673a5de7 MaterialCardView add ripple drawable to foreground
PiperOrigin-RevId: 208993686
2018-08-17 17:15:51 -04:00
marianomartin
2c8209e899 Override Remove view methods in MaterialCardView
PiperOrigin-RevId: 207093142
2018-08-02 18:08:04 -07:00
marianomartin
3b33e5d40f Fix cardview failures, min height should account for content padding to not make the cardview bigger than expected.
PiperOrigin-RevId: 207005747
2018-08-02 18:07:34 -07:00
marianomartin
36cc52f9d8 Add FrameLayout to fix clipping issue with card view
PiperOrigin-RevId: 206958673
2018-08-02 18:06:32 -07:00
cketcham
c73ee1b061 Update ThemeEnforcement to correctly read the android:theme attribute from the style
PiperOrigin-RevId: 206579912
2018-08-02 18:04:42 -07:00
cketcham
7487a539f7 Add support for ThemeOverlays with the default style attr in MaterialCardView and TextInputLayout
PiperOrigin-RevId: 206004683
2018-08-02 17:54:28 -07:00
connieshi
2696568158 Remove default pixel dimension annotation.
PiperOrigin-RevId: 193945912
2018-04-30 11:37:55 -04:00
connieshi
4ceaaf5196 Update foreground of MaterialCardView whenever the radius is set.
PiperOrigin-RevId: 193927619
2018-04-30 11:37:36 -04:00
connieshi
255465bd0d Add getters and setters for strokeColor and strokeWidth in MaterialCardView.
PiperOrigin-RevId: 193338328
2018-04-30 11:29:08 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00