73 Commits

Author SHA1 Message Date
rightnao
2f0935a706 [Card] Support StateListShapeAppearance in MaterialCardView
PiperOrigin-RevId: 785529211
2025-07-24 18:34:07 +00:00
dsn5ft
0697f6fe89 [Gradle] Enable non transitive R classes (resource namespacing) and fix errors
PiperOrigin-RevId: 738871402
2025-03-20 18:34:33 +00:00
pubiqq
bc2fdeadaf [Internal] Prefer platform methods to compat ones
Resolves https://github.com/material-components/material-components-android/pull/4532

GIT_ORIGIN_REV_ID=180dec736f2521579e483317a4d537629d8f247b
PiperOrigin-RevId: 715494344
2025-01-15 18:06:07 +00:00
pubiqq
23aca03255 [Internal] Remove pre-Lollipop checks
Resolves https://github.com/material-components/material-components-android/pull/4266

GIT_ORIGIN_REV_ID=1de7808e66dd6666c893217c76c7499afe2df6a3
PiperOrigin-RevId: 669688797
2024-09-03 13:31:29 +00:00
pubiqq
510881a469 [Internal] Stop using deprecated androidx.core.view.* methods
Resolves https://github.com/material-components/material-components-android/pull/4117

GIT_ORIGIN_REV_ID=dd157e8360c2511810496693cec1616fce578655
PiperOrigin-RevId: 632284856
2024-05-13 17:37:38 +00:00
Material Design Team
31af945caa [MaterialCardView] Support android:duplicateParentState.
MaterialCardView hasn't shown the pressed ripple effect if the parent view is
pressed and it has `android:duplicateParentState=true`, because its foreground
drawable is not a RippleDrawable. This CL fixes the issue.

PiperOrigin-RevId: 567117430
2023-09-21 14:46:51 +00:00
rightnao
dfb9e81eeb [Motion] Motion tweaks
PiperOrigin-RevId: 493105642
2022-12-06 15:22:34 -05:00
rightnao
7d129eae21 [MaterialCardView] Add fade animation for checked icon drawable
PiperOrigin-RevId: 471663189
2022-09-01 17:23:43 -07:00
conradchen
b4cab87015 [Card] Fix crash on Pre-Q devices when checked icon is null
LayerDrawable has this bug that if any of the provided drawables are null during creation, it crashes. The fix is only available on Q+. Fixes this by providing a dummy drawable when we find checked icon is null.

Resolves https://github.com/material-components/material-components-android/issues/2532

PiperOrigin-RevId: 426179927
2022-02-03 20:19:40 -08:00
Material Design Team
cfc00aa5a3 Update android core class definitions across material
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
conradchen
283715d348 [Card] Fix checked icon gravity issues
Re-measures the card when checked icon gravity changes in order to move the icon position. Also corrects the padding adjustment logic for pre-lolipop or when compat paddings are being used.

PiperOrigin-RevId: 408876717
2021-11-10 16:11:35 -05:00
conradchen
bc56d5b43b [M3][Card] Change checkedIconGravity values to enum
PiperOrigin-RevId: 408415041
2021-11-10 16:00:52 -05:00
Gabriele Mariotti
250d56de4b [MaterialCardView] Added option to set the checkedIcon gravity
Resolves https://github.com/material-components/material-components-android/pull/1679

GIT_ORIGIN_REV_ID=a35c862071d83ced72c4d7257f2b7bc93101bfbb
PiperOrigin-RevId: 407662373
2021-11-10 15:35:03 -05:00
ymarian
b06446006c [Card] Fix checked icon tint for API < 21, BitmapDrawables
Resolves https://github.com/material-components/material-components-android/issues/1993

PiperOrigin-RevId: 383754894
2021-07-09 15:29:15 -04:00
Gabriele Mariotti
df0401bd29 [MaterialCardView] Added options to set custom checkedIcon size and margin
Resolves https://github.com/material-components/material-components-android/pull/1613

GIT_ORIGIN_REV_ID=ace8cb8b2e55806760e4d28214bd72afb46a6592
PiperOrigin-RevId: 330932167
2020-09-10 11:14:31 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
marianomartin
4ad50666b2 [MaterialCardView] Checked icon is being squeezed with useCompatPadding
Resolves https://github.com/material-components/material-components-android/issues/795

PiperOrigin-RevId: 304272773
2020-04-03 09:22:16 -07:00
isabellekim
1cdd0428ed Add public attributes to public.xml and add setter & getter for cardForegroundColor to Card.
PiperOrigin-RevId: 293675127
2020-02-07 10:34:25 -05:00
connieshi
12c0e435dc Add reference to Github bug in todo for more context.
PiperOrigin-RevId: 283390765
2019-12-03 17:02:41 -05:00
marianomartin
781e79f4b1 Disable MaterialCardView bitmap drawing
PiperOrigin-RevId: 281825046
2019-11-22 21:27:37 +00:00
ldjesper
294f12498d Rename setCornerRadius to setAllCornerSizes
PiperOrigin-RevId: 272959729
2019-10-04 20:08:43 -04:00
marianomartin
6f10bd0606 Remove minimun dimens from cards inset drawables
Resolves https://github.com/material-components/material-components-android/issues/537

PiperOrigin-RevId: 272951547
2019-10-04 20:08:06 -04:00
cketcham
0547d2a06b Uncouple CornerSize from CornerTreatment
This allows for more easily updating the CornerSize independently from the CornerTreatment and makes it possible to create different types of CornerSizes such as percentage based corners. However, this means corner sizes can be different depending on the bounds of the shape, so the bounds need to be provided. MaterialShapeDrawable has bounds and the ShapeAppearanceModel, so there are new convenience methods there which return the current corner size for the current bounds of the drawable.

PiperOrigin-RevId: 272908508
2019-10-04 15:23:16 -04:00
marianomartin
0f8fa7e6c9 Remove content layout from card view
Due to numerous issues with padding, measure, and crashes with layout bindings. We decided to remove the inner layout.

PiperOrigin-RevId: 271495029
2019-09-27 14:05:20 -04:00
marianomartin
215a839598 Internal cleanup
PiperOrigin-RevId: 267504117
2019-09-12 13:48:16 -04:00
cketcham
7bb525ff59 Update usages of ShapeAppearanceModel to use Builder pattern
PiperOrigin-RevId: 266144471
2019-08-29 15:39:51 -04:00
marianomartin
0d4515cb46 Internal cleanup
PiperOrigin-RevId: 265971745
2019-08-29 14:59:20 -04:00
cketcham
9dc259119e Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 264899197
2019-08-26 11:43:16 -04:00
marianomartin
31d0e9ac4d [MaterialCardView] Add (set|get)Progress
This allows to animate the shape of the card.
Using setProgress so that this works with MotionLayout as well.

PiperOrigin-RevId: 257241960
2019-07-10 13:43:58 -04:00
marianomartin
59a41855fb [MaterialCardView] checked icon sometimes takes up the entire card
PiperOrigin-RevId: 256427401
2019-07-09 12:49:25 -04:00
marianomartin
15f2a245e1 Implement Shapeable in MaterialCardView
PiperOrigin-RevId: 256181803
2019-07-03 14:10:09 -04:00
dniz
5df3bebd63 Update elevation overlays to be based absolute elevation, factoring in the elevation of all parent views
Will follow-up with TabLayout absolute elevation separately

Resolves https://github.com/material-components/material-components-android/issues/381

PiperOrigin-RevId: 255404830
2019-07-03 13:55:49 -04:00
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
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
marianomartin
68357af199 [MaterialCardView] Fix clipping logic to inset by stroke
PiperOrigin-RevId: 235979330
2019-03-08 09:40:38 -05:00
marianomartin
f59949a297 Fix card ripple bug
PiperOrigin-RevId: 233960735
2019-02-24 14:14:49 -05: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
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
dniz
a4964594a1 Add MaterialShapeDrawable setElevation(float) and deprecate setShadowElevation(int)
PiperOrigin-RevId: 228572421
2019-01-10 17:16:43 -05:00