139 Commits

Author SHA1 Message Date
hunterstich
fb7ae01348 [Chip] Added support for variable font axes
PiperOrigin-RevId: 807265798
2025-09-18 16:48:13 +00:00
pubiqq
ae686543ff [Chip] Get default minTouchTargetSize from material attributes
Resolves https://github.com/material-components/material-components-android/pull/4545

  - 8d3f96b7af18c72271b6957d2463bf72ee6c215f by pubiqq <serj.ese@gmail.com>

PiperOrigin-RevId: 760679794
2025-05-21 17:53:42 +00:00
kendricku
79bd7d7b1b [a11y][Chips] Add missing 'button' mention to Talkback output for close icon.
Recording, before:  http://recall/-/hPu3uxWupaB3jE5JXfMuKd/cAF19QKQl7DNPiEUSh5nHq
Recording, after:  http://recall/-/hPu3uxWupaB3jE5JXfMuKd/crZJ8t5wC4xppg19MTmHDE

PiperOrigin-RevId: 726017137
2025-02-12 10:10:49 -08: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
rightnao
a7ff8c9006 [Chip] Fix close icon focus ripple
PiperOrigin-RevId: 708446508
2024-12-23 18:55:42 +00:00
rightnao
03d2c693cb [Chip] Add @Override to Chip#setBackgroundTintList
PiperOrigin-RevId: 702838517
2024-12-05 00:01:57 +00:00
pubiqq
767f25aa49 [Docs] Fix javadoc links
Resolves https://github.com/material-components/material-components-android/pull/4333

GIT_ORIGIN_REV_ID=61739e430bcda13086b83015e4054d7e318cd0d5
PiperOrigin-RevId: 700775734
2024-12-02 20:07: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
Ga\u00ebtan Muller
b3fe6a7f61 [Cleanup] Remove redundant version checks for api <= 19.
Resolves https://github.com/material-components/material-components-android/pull/3849

GIT_ORIGIN_REV_ID=47bb2fcc8031740e5a7d4f741f1ada2af025e126
PiperOrigin-RevId: 632154861
2024-05-09 18:46:02 +00:00
kendricku
41eb087003 [Chip] Update Chip javadoc to reference CompoundButton.OnCheckedChangeListener instead of AppCompatCheckBox.OnCheckedChangeListener.
PiperOrigin-RevId: 631036631
2024-05-07 18:46:28 +00:00
rightnao
e3b255b3a0 [Docs] Crosslink github docs in javadocs
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
dsn5ft
2702b1a8d5 [Chip] Fix hand pointer icon not showing up on whole Chip when using mouse input
PiperOrigin-RevId: 513621349
2023-03-03 16:26:47 +00:00
pfthomas
777ba0d55a [Chip] Fix API requirement
PiperOrigin-RevId: 461030541
2022-07-14 19:59:14 +00:00
conradchen
413a047957 [ChipGroup] Fix ChipGroup.getCheckedChipIds() returns wrong state
In the Chip implementation, onCheckedChangeListener was called before onCheckedChangeListenerInternal. This causes an issue that in onCheckedChangeListener's callback, the checkable group's checked state is not updated yet, therefore ChipGroup.getCheckedChipIds() will return the outdated checked state.

Fixes this by overriding Chip.setOnCheckedChangeListener to get full control of the execution order between onCheckedChangeListener and onCheckedChangeListenerInternal.

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

PiperOrigin-RevId: 449100861
2022-05-17 11:04:03 -04:00
pfthomas
d4c2c95490 [Chip][a11y] Make multi-selection Chips announced as Buttons
PiperOrigin-RevId: 447993125
2022-05-11 14:58:44 -04:00
pubiqq
3ca41be8f0 [General] Fix typos
Resolves https://github.com/material-components/material-components-android/pull/2654

GIT_ORIGIN_REV_ID=b8f6728979875629f2c813ef90d2f671cf56b4eb
PiperOrigin-RevId: 442852630
2022-04-19 14:48:55 -04:00
conradchen
788866e448 [Chip] Fix chip layout not updated when programmatically setting text size
We didn't forward Chip.setTextSize() call properly to ChipDrawable.setTextSize(). Fixes this by properly overriding the method.

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

PiperOrigin-RevId: 442056225
2022-04-15 14:18:11 -04:00
pfthomas
a51d1dcb68 [MaterialTimePicker][a11y] Update accessibility className used for hour/minute Chips
PiperOrigin-RevId: 436207977
2022-03-21 18:53:24 +00:00
conradchen
f3c6430f94 [ChipGroup] Refactor chip group selection logic to a standalone class
This CL pulls out the checkable group logic to a standalone class, which can be shared by different UX components. It also makes chip groups support multiple selection better with introducing a new listener based on the multiple selection and deprecates the old listener which only supports single selection.

PiperOrigin-RevId: 427204476
2022-02-09 15:55:24 +00:00
jeremymuhia
90787bf0e0 [TextAppearance] fix drawables not applying system level bold
PiperOrigin-RevId: 421066050
2022-01-12 11:21:15 -05:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
pfthomas
c6be59ce8b [Chip][a11y] Fix system level bold not applied
PiperOrigin-RevId: 408609073
2021-11-10 16:02:22 -05:00
dsn5ft
9ae56ceedd [Javadocs] Remove all broken attr links from Javadocs
PiperOrigin-RevId: 404246710
2021-10-20 19:06:18 +00:00
conradchen
37bb2efb38 [Chip] Rollback workaround of ExploreByTouchHelper bug
The original bug has been fixed.

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

PiperOrigin-RevId: 397813859
2021-09-21 08:07:41 -07:00
conradchen
7085319b35 [Chip] Fix touching cannot put focus on chips with Talkback
We disabled ChipTouchHelper on purpose to workaround a Talkback issue but we didn't stop forwarding touch/hover events to ChipTouchHelper, which cause some Talkback logic work incorrectly on certain API levels.

Adds a state variable to avoid using ChipTouchHelper when it's not registered as accessibility delegate to solve the issue.

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

PiperOrigin-RevId: 383911836
2021-07-12 19:41:11 +00:00
conradchen
31ca1106ab [Chip] Report a11y class name as RadioButton in single selection mode
Also consolidates the logic of reporting a11y class name.

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

PiperOrigin-RevId: 383849367
2021-07-12 19:38:32 +00:00
isabellekim
738cccb433 [Chip] Update javadocs @see methods to match the actual methods.
PiperOrigin-RevId: 344160354
2020-11-25 10:28:33 -05:00
connieshi
93f4f161cd [Chip] If a close icon is purely decorative (e.g. no closeIconClickListener is specified), the close icon should not intercept the click and instead let the superclass manages the touch event for the overall chip.
PiperOrigin-RevId: 338260731
2020-10-21 15:51:08 -07:00
connieshi
8544f7acc2 [Chip] Include font padding.
Resolves https://github.com/material-components/material-components-android/issues/1424

PiperOrigin-RevId: 318817230
2020-06-29 16:17:12 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
Material Design Team
76ffe35fef Cleanup
PiperOrigin-RevId: 313865830
2020-06-01 16:52:06 -04:00
Rafael
45f59032c8 [Chip]Fix chip icon with different width and height
Resolves https://github.com/material-components/material-components-android/pull/1242

GIT_ORIGIN_REV_ID=2c843f543245ac17327cbc55566eb3f8098d9082
Co-authored-by: wcshi <38438920+wcshi@github.com>
PiperOrigin-RevId: 309745804
2020-05-04 11:42:31 -04:00
connieshi
0687ca80b0 Fix javadocs errors in Chip and ChipDrawable.
PiperOrigin-RevId: 300592847
2020-03-13 11:11:29 -04:00
Material Design Team
5213b46edd [Chip] Support setting checked icon's tint via xml attribute
PiperOrigin-RevId: 299429881
2020-03-09 10:45:57 -07:00
connieshi
ded0c3ff61 Initialize chipCornerRadius to -1 instead of 0 so it would not ignore a user who sets the corner radius to 0.
Resolves https://github.com/material-components/material-components-android/issues/1058

PiperOrigin-RevId: 297422651
2020-02-27 15:49:57 -05:00
isabellekim
1f9de68025 [All] Add support for materialThemeOverlay
Resolves https://github.com/material-components/material-components-android/pull/948

GIT_ORIGIN_REV_ID=5a8bb35a56c1b813df47d964de8482a26e0da66d
PiperOrigin-RevId: 293839172
2020-02-10 09:55:19 -05:00
Material Design Team
253cdc2114 Add CollectionInfos and CollectionItemInfos to ChipGroup and Chip for accessibility.
PiperOrigin-RevId: 288944549
2020-01-10 09:05:36 -08:00
Material Design Team
ba8e18ea62 Fix RTL padding issue on Chips.
PiperOrigin-RevId: 288737367
2020-01-08 12:11:28 -08:00
dniz
d72f3bc7d0 Remove log line from Chip
PiperOrigin-RevId: 286572627
2019-12-21 08:48:40 -05:00
connieshi
a3204758f9 Fix chip text mis-alignment when its width is less than the minimum recommended touch target width.
Resolves https://github.com/material-components/material-components-android/issues/800

PiperOrigin-RevId: 286421752
2019-12-19 15:46:43 -05:00
connieshi
2a9c3f3ad1 Automated g4 rollback of changelist 283714901
PiperOrigin-RevId: 283801062
2019-12-05 14:45:24 -05:00
connieshi
415628f1cd Automated g4 rollback of changelist 283621202
PiperOrigin-RevId: 283714901
2019-12-05 14:37:46 -05:00
connieshi
e3be6b0e85 Support setting textAllCaps in textAppearance xml, switch from calling setSingleLine to setLines(1) so the transformation methods don't replace each other.
android:textAllCaps="true" in the layout xml is being ignored because:

1) A known issue where Chip only reads from its textappearance. However, even after creating a custom textappearance that sets textAllCaps to true, I'm observing an odd behavior:
if I comment out the setSingleLine method call in the constructor, then the text becomes all caps. If I comment setSingleLine back in and call setAllCaps, then the text becomes capitalized and single line.

I think it's related to two different transformation methods being applied. The one inside setsingleline clobbers the one set by setAllCaps.

TextView's constructor applies the singleLine transformation before applying text appearance attributes
https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/widget/TextView.java#L1570-L1609

https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/widget/TextView.java#L10232

2) The library implementation of TextAppearance reads from "textAllCaps" instead of "android:textAllCaps".
11c57abbd6/lib/java/com/google/android/material/resources/TextAppearance.java (L96)
However, if you call Chip#setTextAppearance(@StyleRes int id) which passes it the super method, then "android:textAllCaps" needs to be set because "textAllCaps" is ignored
::sigh::

PiperOrigin-RevId: 283621202
2019-12-05 14:33:18 -05:00
Material Design Team
bb72e50930 Automated g4 rollback of changelist 281530369
PiperOrigin-RevId: 281569140
2019-11-22 21:24:02 +00:00
Material Design Team
32362bed3d Automated g4 rollback of changelist 281519201
PiperOrigin-RevId: 281530369
2019-11-22 21:23:01 +00:00
connieshi
39e62ec220 Remove attrs check inside Chip#initMinTarget because the current context's theme may have custom values.
PiperOrigin-RevId: 281519201
2019-11-20 14:40:33 -05:00
connieshi
b58d3481c3 Restore padding after #setRippleColor update a chip's background.
PiperOrigin-RevId: 278660797
2019-11-06 10:18:27 -05:00
ldjesper
294f12498d Rename setCornerRadius to setAllCornerSizes
PiperOrigin-RevId: 272959729
2019-10-04 20:08:43 -04:00
connieshi
c1c55475f3 Suppress ClickableViewAccessibility lint error in Chip#onTouchEvent.
PiperOrigin-RevId: 271128148
2019-09-26 17:55:16 -04:00