314 Commits

Author SHA1 Message Date
Nobody
7c19c196a7 Add imageViewSize property to MDCChipView.
PiperOrigin-RevId: 750667661
2025-04-23 11:40:01 -07:00
Nobody
24a0ffbd03 Annotate various Delegate protocols as NS_SWIFT_UI_ACTOR
PiperOrigin-RevId: 708413470
2024-12-20 13:33:55 -08:00
Nobody
f692bd8cbd Added a fixed vertical margin between chips for large and small fonts:
PiperOrigin-RevId: 679056065
2024-09-26 02:16:26 -07:00
Nobody
c87bdfa8b2 Updates chips to use a dynamically calculated height instead of a fixed height.
PiperOrigin-RevId: 676298831
2024-09-19 00:32:45 -07:00
Nobody
444f8db6ae Added [.selected, .disabled] state
PiperOrigin-RevId: 675596750
2024-09-17 09:28:51 -07:00
Nobody
86241a2598 Make textField padding and text inset an editable variable in chipField
PiperOrigin-RevId: 652493790
2024-07-15 08:42:01 -07:00
Janette James
f1d9201896 Update the selectedImageView's tint when the tintColor changes
PiperOrigin-RevId: 633351188
2024-05-13 15:31:37 -07:00
Jeff Verkoeyen
02cd6376bd [Chips] Allow chips to be selected in MDCChipField.
Prior to this change, MDCChipField's chips would respond to tap gestures by showing a highlight state but the chips would not become selected. This meant that it was not possible to tap a chip and then delete it by pressing the backspace key, as is the expected behavior.

This change introduces a tap gesture onto each chip view that is added to the field. When a chip view is tapped, the chip view's selection state is toggled.

After this change, the user will now be able to select one or more chips and delete them by pressing the backspace button.

PiperOrigin-RevId: 626041379
2024-04-18 08:24:12 -07:00
Jeff Verkoeyen
910070cbf1 [ChipField] Fix reflow layout bug with text field in tight spaces.
When entering text into a chip field, the text field is expected to reflow to the next line if there is not enough space on the current line for the text field's content to be seen. Similarly, if the text field's content shrinks such that it can again fit on the previous line, then the text field is expected to move back to the previous line. This effect provides a sense of object persistence between the text field and the chips it creates.

Prior to this CL, the text field would not consistently reflow to the next line once it ran out of space, causing the text field to stay at an unreasonably narrow width. This made it difficult to see the full contents of the text field and to select text within it.

The root problem was that the logic for determining when a reflow should occur relied on assuming that the text field and chip frames had the same mid-y point. This assumption isn't always a given, so the logic was incorrectly concluding that the text field was always "on the next line".

This CL introduces a change that widens the check for "on the same line" by checking if the text field's mid-y point is contained within the chips' min/max y values.

After this CL, the text field correctly moves to and from the next line as text is entered.

PiperOrigin-RevId: 625687941
2024-04-17 08:15:20 -07:00
David Collazo
45fd468743 Add UIAccessibilityCustomAction for Chip deletion.
PiperOrigin-RevId: 616255618
2024-03-15 15:14:38 -07:00
David Collazo
00fac7e679 Delete transitory legacy fork for MDCChipField and MDCChipFieldDelegate.
PiperOrigin-RevId: 592372166
2023-12-19 16:15:20 -08:00
David Collazo
7fd4094424 Change MDCChipField to use UITextField instead of MDCTextField.
PiperOrigin-RevId: 591304366
2023-12-15 11:01:16 -08:00
David Collazo
50dba9a91b Add transitory legacy fork for MDCChipField and MDCChipFieldDelegate.
PiperOrigin-RevId: 590253565
2023-12-12 10:30:45 -08:00
David Collazo
9d578d398d Add public deleteButtonImage UIImage property to MDCChipField
PiperOrigin-RevId: 520924582
2023-03-31 08:08:08 -07:00
David Collazo
46a05047da Add disableInkAndRippleBehavior and tintColor to Chips.
PiperOrigin-RevId: 520359324
2023-03-29 09:38:11 -07:00
Randall Li
3570fa86da [MDCChipViewAccessoryView] Change deprecation warning to point at newer recommendation.
PiperOrigin-RevId: 492182465
2022-12-01 06:49:52 -08:00
Randall Li
955a770c48 [MDCTextFields] Change deprecation warning to point at migration guide.
PiperOrigin-RevId: 490322152
2022-11-22 13:30:34 -08:00
Randall Li
6eb16e54b0 [MDCChips] Removing deprecation of private API of chips because they are no longer going to be replaced with UIButtons.
They may be replaced with M3CButtons.

PiperOrigin-RevId: 489471877
2022-11-18 07:44:19 -08:00
Wenyu Zhang
71dbf5f8ae [Shadow] Merge shadow color (UIColor) into MDCShadow class.
PiperOrigin-RevId: 487427548
2022-11-09 21:21:48 -08:00
Randall Li
6d9723fdfb [Chips] Removed deprecated API annotation.
We will likely continue to use a component for Chips because they will be shorter than the 44dp that UIButton easily allows.

PiperOrigin-RevId: 485883651
2022-11-03 08:48:26 -07:00
Randall Li
de2dabc46c [Chips] add NS_ASSUME_NONNULL_BEGIN annotation.
PiperOrigin-RevId: 485345704
2022-11-01 10:02:10 -07:00
Nobody
e7619686aa Fix parameter name in documentation comment.
PiperOrigin-RevId: 479070089
2022-10-05 09:50:17 -07:00
Nobody
9e1c0c0a45 Internal change
PiperOrigin-RevId: 477458164
2022-09-28 08:26:32 -07:00
Randall Li
9100ba8f35 [Color blending] Delete colorBlending API from ColorSchemes. Use MDC Color component instead.
Migrate remaining colorBlending API use from ColorSchemes to the MDC Color component.

PiperOrigin-RevId: 464917740
2022-08-02 16:44:21 -07:00
Randall Li
0937378683 [Chips Themer] Remove ColorBlending API. Use Color component's color blending API instead.
PiperOrigin-RevId: 464088860
2022-07-29 09:00:37 -07:00
Jeff Verkoeyen
b2bbd50350 Mark all To Be Deprecated APIs as Deprecated.
PiperOrigin-RevId: 460478209
2022-07-12 09:13:52 -07:00
David Collazo
cb57157237 Mark symbols to be deprecated
Follow go/material-ios-buttons and go/material-ios-chips for guidance instead.

PiperOrigin-RevId: 458243013
2022-06-30 09:23:43 -07:00
Randall Li
2eaeeed3b8 [ChipViewAccessory] Fixed typo in preferredSize API.
PiperOrigin-RevId: 452540407
2022-06-02 08:10:49 -07:00
Randall Li
cd2991ead9 [ChipViewAccessory] Fixed typo in preferredsize API.
PiperOrigin-RevId: 452517770
2022-06-02 05:50:08 -07:00
Randall Li
b587110b00 Create a sizeable accessory view for iOS 13 clients.
PiperOrigin-RevId: 452276091
2022-06-01 05:55:43 -07:00
Cody Weaver
a408d5b2a1 [DynamicType] Mark mdc_adjustsFontForContentSizeCategory as deprecated.
PiperOrigin-RevId: 450432566
2022-05-23 07:26:15 -07:00
Yarden Eitan
034d4b4905 Internal Change
PiperOrigin-RevId: 428767519
2022-02-15 06:43:34 -08:00
Nobody
d9120b2bde MDCChipField now consistently shows the delete button to all chips when. showChipsDeleteButton=true. Previously, the button was not shown for pre-added chips.
PiperOrigin-RevId: 425921164
2022-02-02 10:39:06 -08:00
Wenyu Zhang
b457b13005 Internal change.
PiperOrigin-RevId: 417635153
2021-12-21 09:32:05 -08:00
Jeff Verkoeyen
86a8c97dc7 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400788645
2021-10-04 12:41:07 -07:00
Jeff Verkoeyen
c34de39e30 Internal change.
PiperOrigin-RevId: 397316843
2021-09-17 07:45:01 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
96cfc7e331 Internal change
PiperOrigin-RevId: 394241967
2021-09-01 08:56:53 -07:00
Wenyu Zhang
88ecdb962d [MDCChipView] Clean up and remove _visibleAreaInsets ivar.
PiperOrigin-RevId: 393004135
2021-08-25 16:29:01 -07:00
Cody Weaver
08d01596df [MultipleComponents] Remove mdf_effectiveUserInterfaceLayoutDirection in favor of the system API effectiveUserInterfaceLayoutDirection that was added in iOS 10.
PiperOrigin-RevId: 391307973
2021-08-17 09:30:47 -07:00
Alyssa Weiss
6ccb268a37 Move FontScaler APIs in MDCTypography to a separate directory.
PiperOrigin-RevId: 390642325
2021-08-13 10:33:45 -07:00
Alyssa Weiss
830853be30 Fix typo that read depricated instead of deprecated.
PiperOrigin-RevId: 385167363
2021-07-16 09:57:07 -07:00
Alyssa Weiss
5bbcd44dbd Mark mdc_adjustsFontForContentSizeCategory as to be deprecated for multiple components.
PiperOrigin-RevId: 385145075
2021-07-16 07:47:24 -07:00
Andrew Overton
0727135757 [Chips] Explicitly trigger layout pass
PiperOrigin-RevId: 383412610
2021-07-07 08:03:43 -07:00
Alyssa Weiss
9107b8fe42 Remove adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable API from MDCChipView.
PiperOrigin-RevId: 376256843
2021-05-27 15:03:34 -07:00
Alyssa Weiss
85cdcadbec Update MDC chip examples to no longer use mdc_adjsutFontForContentSizeCategory to support Dynamic Type.
PiperOrigin-RevId: 371925667
2021-05-04 09:04:07 -07:00
Andrew Overton
5cd7b82f1b [Material-iOS/Chips] Extract clear button from MDCChipField
PiperOrigin-RevId: 369654054
2021-04-21 07:53:48 -07:00
Nobody
32fdb16b23 This CL makes two changes:
1. Adds a new delegate method `chipFieldShouldEndEditing` to match `chipFieldShouldBeginEditing`
2. Moved the call to the chip field delegate for `chipFieldDidBeginEditing` and `chipFieldDidEndEditing` so they are fired at the correct time.

I noticed that the UITextFieldDelegate method `textFieldShouldBeginEditing` can be called without actually becoming the first responder if the previous first responder doesn't resign it. That meant that the chip field would still claim to have begun editing even if it hadn't.

PiperOrigin-RevId: 367240207
2021-04-07 09:56:09 -07:00
Alyssa Weiss
924c49e43b Remove all iOS 10 availability checks from material_components_ios now that only iOS 10+ is supported.
PiperOrigin-RevId: 366437050
2021-04-02 06:33:16 -07:00
Jeff Verkoeyen
1c14fb5e7b Internal change.
PiperOrigin-RevId: 363294413
2021-03-16 16:23:36 -07:00