77 Commits

Author SHA1 Message Date
Nobody
8f69468a2f Update Material iOS to compile for visionOS
PiperOrigin-RevId: 641364760
2024-06-07 14:52:13 -07:00
Randall Li
ec2d41dfdb [MDCCollections] Change deprecation warning to point at migration guide.
PiperOrigin-RevId: 490282427
2022-11-22 10:54:27 -08: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
f9a059900c Mark symbols to be deprecated
Follow go/material-ios-lists for list guidance instead.

PiperOrigin-RevId: 457737559
2022-06-28 08:37:20 -07:00
Jeff Verkoeyen
c34de39e30 Internal change.
PiperOrigin-RevId: 397316843
2021-09-17 07:45:01 -07:00
Alyssa Weiss
1b69273926 Delete MDCTypography font opacities.
PiperOrigin-RevId: 394494448
2021-09-02 10:44:20 -07:00
Cody Weaver
272781fd85 [MDFInternationalziation] Remove mdf_semanticContentAttribute in favor of system API semanticContentAttribute.
PiperOrigin-RevId: 392680954
2021-08-24 09:29:08 -07:00
Cody Weaver
ce90d137bc [MDFInternationalization] Remove mdf_imageWithHorizontallyFlippedOrientation in favor of system API, imageWithHorizontallyFlippedOrientation.
PiperOrigin-RevId: 391987777
2021-08-20 07:33:33 -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
Jeff Verkoeyen
eb82984224 Internal change
PiperOrigin-RevId: 331764642
2020-09-15 07:31:56 -07:00
Yarden Eitan
8d7bc88a11 [Ink] Official deprecation of Ink.
Please use the Ripple component.

PiperOrigin-RevId: 329771765
2020-09-02 13:07:40 -07:00
featherless
8cea56b405 Enable Catalyst support for the catalogs.
Turning this support on revealed a new class of error:

```
Implicit conversion from integral type 'int' to 'BOOL'
```

These errors have been fixed where applicable.

Note that due to https://stackoverflow.com/questions/58547010/ios-catalyst-cocoapod-framework-error-signing-requires-a-development-team, each of the icons pod targets needs to have its Signing Certificate value manually set to "Sign to Run Locally".

Separately, due to https://github.com/onmyway133/blog/issues/572 we also need to disable Library Validation on the projects.

Closes https://github.com/material-components/material-components-ios/pull/10059

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/10059 from jverkoey:catalyst 66127447f2d9e26942f2543ccdb3d2963caa30fa
PiperOrigin-RevId: 326058707
2020-08-11 11:10:36 -07:00
Yarden Eitan
f8465c8fb3 [Collections] Add Ripple as an opt-in for MDCCollections and MDCCollectionCells
PiperOrigin-RevId: 318026061
2020-06-24 02:09:05 -07:00
Robert Moore
800188a649
{clang-format} Format the components. (#6347)
This is a follow-up to https://github.com/material-components/material-components-ios/pull/6027

```
find components \( -name "*.h" -or -name "*.m" \) | xargs clang-format -i
```
2019-01-23 11:08:43 -05:00
Robert Moore
74a27253e8
Global replace of integral single-precision literals with integer literals. (#5709)
Global replace of integral single-precision literals with integer literals.

Regular expression used:
```perl
/[^\w]([0-9]+)\.[0]*[fF]/$1/
```
2018-11-08 14:02:04 -05:00
featherless
2181084272
[automated] Standardize our open source license stanza to what Xcode generates. (#4985)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on #4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at

http://www\.apache\.org/licenses/LICENSE-2\.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at
 http://www\.apache\.org/licenses/LICENSE-2\.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 12:13:07 -04:00
Jeff Verkoeyen
9854044c96 Revert "[automated] Standardize our open source license stanza to what Xcode generates. (#4982)"
This reverts commit b45bc2fdd4dfe12fc76751a45c9cf7b0d6c1261f.
2018-08-31 12:01:24 -04:00
featherless
b45bc2fdd4
[automated] Standardize our open source license stanza to what Xcode generates. (#4982)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on https://github.com/material-components/material-components-ios/pull/4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

### Find

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at
 http://www\.apache\.org/licenses/LICENSE-2\.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

### Replace

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 11:49:00 -04:00
Andrew Overton
6983358267
Support more than three lines in MDCCollectionViewTextCell? (#4718)
The issue is that our internal client was setting numberOfLines to 0 on both title and detail labels in the MDCCollectionViewTextCell, which resulted in there being more than 3 lines of text, which the cell currently cannot handle. When the number of visible lines isn't equal to 1, 2, or 3, it just doesn't update the Y origins of the labels. The change I'm suggesting will make it so that in scenarios where there are more than 3 lines of text the Y origins of these labels are updated. I am alerting the internal client that a change to their codebase _may_ be necessary as well. 

Closes #4037
2018-08-22 12:53:51 -04:00
Adrian Secord
72045ffd6d
[Docs] Updated known short link destination URLs to use short links. (#3575)
* Updated known shortlink destination URLs to use short links.

* Updated stray links in the CHANGELOG.md.

* Fixed FAB shortlink.

* Applied replacements to everything outside of components/.
2018-04-28 11:27:59 -04:00
ianegordon
7bc25ac4e6
[Collections] Fix image sizing (#3027)
[Collections] Fix image sizing
2018-03-01 16:32:24 -05:00
Mohammad Cazi
261828a056
[Warnings Fix] Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior. (#2933)
* Warning Fix: Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior.

* 100 char limit.
2018-02-14 15:47:07 -05:00
Ben Hamilton (Ben Gertzfield)
b089e47b4f [CollectionCells] Support images larger than 40x40 in MDCCollectionViewTextCell (#2912)
Calling -[UIImageView sizeToFit] will resize the view to fit the image inside.

MDCCollectionViewTextCell currently assumes the image will be 40x40, but
doesn't handle images other than this size.

Currently, if the image is larger than 40x40, the -sizeToFit call on
the image view will cause the view to go outside the bounds of
MDCCollectionViewTextCell and overlap the text.

Fixes #2911.

Reviewers: I'd like to add unit tests for this, but I'm not sure how to run MDC tests.
Any suggestions?
2018-02-14 14:15:24 -05:00
Yarden Eitan
3fe2bff374
[Podspec] Fix podspec warnings when issuing a lint (#2811)
* added supressing of partial-availability and changed image bit depth to remove podspec warnings on linting

* added code check
2018-01-08 11:45:11 -05:00
featherless
b9404ded10
Revert "Add compile time flag for import style (#2562)" (#2612)
This reverts commit 6791dc4993d3a0ffa11735eeeef0583102621d52.
2017-12-06 11:22:17 -05:00
Louis Romero
6791dc4993
Add compile time flag for import style (#2562)
Closes #2550
2017-12-04 10:06:31 -08:00
Junius Gunaratne
10047dfbc9 [Ink] Enable updated ink for collection views (#2546)
* Enable updated ink for collection views

* Set usesLegacyInkRipple in cell
2017-12-01 19:01:46 -05:00
Sylvain Defresne
c3615fa300 Use framework-style imports. (#2428)
* Use framework-style imports.

MDFInternationalization is built as a framework, so use the style
recommended to import from the framework (#import <...>).

MotionAnimator and MotionInterchange mixed the normal style import
and the framework style import; settle them on the framework style.

* Update MDCActivityIndicator.m

Re-order to match our style guide.

* Update MDCBottomNavigationBar.m

Re-order to match our style guide.

* Update MDCBottomNavigationItemView.m

Re-order to match style guide.

* Update MDCBottomAppBarView.m

* Update MDCButtonBar.m

* Update MDCAppBarButtonBarBuilder.m

* Update MDCAppBarButtonBarBuilder.m

* Update MDCCollectionViewCell.m

* Update MDCAlertController.m

* Update NavigationBarIconsExample.m

* Update MDCNavigationBar.m

* Update MDCItemBarCell.m

* Update MDCTextField.m

* Update MDCThumbTrack.m
2017-11-17 10:39:48 -05:00
Robert Moore
5b33ae0c0b
[Collections] Change image when accessoryType changes (#2354)
Clients were unable to change the image of a cell's accessory type without
reloading the entire cell in the collectionView.

Closes #2353
2017-11-06 12:08:27 -05:00
Yurii Samsoniuk
6f5fb72de0 [CollectionCells] Migrated to MDFi18n. (#2248)
* [CollectionCells] Migrated to MDFi18n.

* Swapped dependencies from MDCRTL to MDFi18n
2017-10-26 11:38:29 -04:00
Cody Weaver
a462a2ac4f [Mutliple components] Update components that use colors to use MDCPalette. (#2129)
* Update components that use colors to use MDCPalette.

* Update podspec to make palettes available to Collection Cell
2017-10-09 12:53:50 -04:00
Robert Moore
080cc37058 [Collections] Replacing macros with function calls (#1787)
A few colors were generated using macros, so they are now replaced with
actual method and function calls.

References #1682
2017-08-11 17:53:59 -04:00
Robert Moore
8b5aeec8e4 [Collections] Make cell font values functions (#1763)
MDCCollectionViewTextCell has a few #define maros that are named like
constants but expand into method invocations.  Replacing these with
static inline functions.

References #1682
2017-08-10 11:17:46 -04:00
Robert Moore
e12db0f2ea [Collections] Making Disclosure indicator tinted (#1745)
Collection cell accessory views set to "Disclosure Indicator" will now
use template mode and will utilize the tinting of the cell/collection
view.

Closes #1575
2017-08-07 15:09:11 -04:00
Robert Moore
44e7c7974b [Collections] Only change selected icon if needed (#1692)
The `-setSelected:` method reassigns the selection icon image every time
a cell is dequeued/reused. Since most cells are unselected most of the
time, this results in a lot of unnecessary UIImage calls.  Only updating
the selected/unselected image if the view exists (it won't until
initially changed to Editing Mode) and if the state has changed.

Closes #1708
2017-07-31 09:18:15 -04:00
ianegordon
c1ce8bcca1 [Collections] Reuse label frames (#1705)
MDCCollectionViewTextCell computes the frames of the two UILabel subviews to determine their size, then again to determine how many lines of text will be in the cell. Instead of computing the frames twice, the first computation will simply be reused.

Closes #1699
2017-07-27 08:58:08 -04:00
Robert Moore
6785e7a0d3 [Collections] Extend cell label to superview width (#1661)
MDCCollectionViewTextCells will no longer trim their label widths to the
width of the rendered text and will extend to the width of the
contentWrapper.  This allows textAlignment properties to be effective
for lines shorter than the contentWrapper width.

Closes #1632
2017-07-21 13:57:47 -04:00
Robert Moore
565ae15cdb [Collections] Use image cache for selection icons (#1638)
* [Icons] Add icon method for use with imageNamed

Icon images are currently loaded manually from a path in a bundle and therefore bypass the internal UIImage caching mechanism. This change will add new methods that provide the icon images via the -imageNamed family of methods.

Closes #1637, #1606
2017-07-14 16:50:39 -04:00
Robert Moore
25b7c217ca [CollectionCells] Reset cells in prepareForReuse (#1633)
MDCCollectionViewTextCell now resets all documented text label
properties in `-prepareForReuse`.

Closes #1631
2017-07-12 12:54:57 -04:00
Robert Moore
fa10d655d7 Remove uses of typeof and the ?: operator (#1601)
Make the code base more portable by replacing some GNU extension code
with C99-compatible versions.

* Replace shortcut ?: operator with explicit middle (true) terms
* Remove pointer inequality checks in conditionals
* (Cleanup) Change to #include for <tgmath.h> based on style guide

Closes #846
2017-07-11 17:39:45 -04:00
Adrian Secord
4dba0dfff8 Add -Wstrict-prototypes and fix errors. (#1532) 2017-06-19 17:33:37 -04:00
Scott Hyndman
4a011e75a5 [Docs] Docstravaganza (#1330)
* [Docs] Adds platform configuration for the doc site.

* [Docs] Adds path metadata for documentation site.

This field is used to determine where the file will appear in the
doc site.

* [Docs] Updates Material guideline links to latest URL.

material.google.com -> material.io/guidelines

* [Docs] Introduces a separate component index for the docsite.

* [Docs] Changes the directory used for site generation.

* [Docs] Moves documentation-site-only Markdown into its own directory.

* [Docs] Changes material.io links to use https.

* [Docs] Renames the howto and contributing docsite sections to docs.

* [Docs] Adds a navTitle field to the collection editing/styling pages.

* [Docs] Changes the FAQ heading to be one size bigger.

* [Docs] Changes the tutorial title.

* [Docs] Adds icons to three more components.

* [Docs] Introduces a root component directory called /catalog/.

* [Docs] Adds an icon to the AnimationTiming component.

* [Docs] Adds an icon for the typography component.

* [Docs] Reformats the docsite index.
2017-05-01 17:27:38 -04:00
Will Larche
ff5d165869 [Math] New private math component (#1325)
* [Math] New private component.

* [Math] Putting MaterialMath everywhere it could help.
2017-04-17 16:14:17 -04:00
Will Larche
8c5350de31 [All] Formatting. (#1269) 2017-03-22 12:18:15 -04:00
Louis Romero
4cbdfb9e31 [CollectionCells] Add accessibility hint in edit mode (#1258)
* [CollectionCells] Add accessibility hint in edit mode

When editing, selectable/deselectable cells now give an accessibility
hint: "Double tap to select.". This helps users to know what they can do
while in edit mode.

Related: https://github.com/material-components/material-components-ios/issues/1257

* Add tests
2017-03-21 10:54:13 -04:00
Justin Shephard
5db1b8add5 [Ink] - Fix memory leak in Ink and correct issues with ink when re-using cells (#1180)
* [Collections] - Initial changes

* [Ink] - Updated MDCInkLayer to allow for multiple foreground and background ripples that stay referenced as opposed to one and one.

* [Ink] - Code cleanup, indentions, removed unused properties

* [Ink] - Line character counts

* [Ink] - More code cleanup, renaming, line spacing

* [Ink] - Updated docs

* [Ink] - Renamed methods

* [Ink] - Added state of cancelled for ink to prevent completion block calling

* [Ink] - Moved some api to private, updated completion blocks to incorporate weakSelf/strongSelf

* [Ink] - Removed testing and example code

* [Ink] - Additional demo code removed

* [Ink] - Broke retain cycle in ink

* [Ink] - Prevent over removal of ink layers caused by animation delegate being called on animation end AND removal

* [Ink] - Pulled completion block setting out if not needed

* [Ink] - Updated naming convention

* [Ink] - Addressing comments (possible crash on setting inkView to nil on collection cell, naming)

* [Ink] - Added easy out on setInkView method, styling for property declarations

* [Ink] - Renamed clearAllAnimations method to get in tandem with removeAllAnimations method on super class of CALayer

* [Ink] - Removed dependence on indexing for unedited ripples and rather using array count property
2017-02-13 13:29:59 -05:00
Adrian Secord
7ba66bf09c Formatted all Objective-C sources with clang-format. (#1133) 2017-01-05 10:17:24 -05:00
Adrian Secord
e93a16ca02 Capitalize "Material" in documentation (#1014)
* s/material design/Material Design/g

* s/material components/Material Components/g

* s/material\([ \t\n]\)/Material\1/g

* s/aterial design/aterial Design/g
2016-12-13 08:06:55 -05:00
Adrian Secord
8bc7a849ca Remove struct hacks (#992)
* Remove CGRect struct hacks.

* Fixed typo.
2016-12-09 15:59:50 -05:00
Jackie Quinn
27c514f4b8 [CollectionCells] Layout subviews after updating interface for editing (#989)
Moves call to layoutForegroundSubviews to follow call to
updateInterfaceForEditing to prevent the case where as the user
scrolls down in editing mode, the editing controls animate in and
cover parts of the content view.

BUG=988
2016-12-09 07:34:52 -05:00