49 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Adrian Secord
4dba0dfff8 Add -Wstrict-prototypes and fix errors. (#1532) 2017-06-19 17:33:37 -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
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
Jackie Quinn
3730aa2c58 Add "selected" accessibility trait when cell is selected in edit mode (#967)
Adds UIAccessibilityTraitSelected when cell is selected and removes
it when cell is deselected.
2016-12-07 15:21:11 -05:00
Louis Romero
bb78cbb9d4 Set checked cell's accessibility trait to Selected
Summary:
When the accessory type is Checkmark, the accessibility trait Selected
is added.

This closes
https://github.com/google/material-components-ios/issues/840.

Reviewers: cjcox, ajsecord, O1 Material components iOS

Reviewed By: ajsecord, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1883
2016-11-16 11:09:29 +01:00
Gauthier Ambard
ba36035d48 Add color property for editing selector in MDCCollectionViewCell (#844)
This commit adds a property for the color of the editing selector.

This closes #842
2016-11-15 09:37:20 -08:00
Louis Romero
c6f6fb8546 [CollectionCells] Handle separator insets correctly in RTL
Summary:
Old behavior in RTL:
https://cloud.githubusercontent.com/assets/197492/20139244/6f29e752-a685-11e6-804a-f016f1029532.png

New behavior in RTL:
https://cloud.githubusercontent.com/assets/197492/20143972/57ad8988-a69b-11e6-9817-9a6d40d120d2.png

This closes https://github.com/google/material-components-ios/issues/845

Test Plan:
Open Catalog in RTL language (or pseudo-language).
Collections > Cell Separator Example
=> Check that Section 0 has a separator on the left and Section 1 has a
separator on the right.

Reviewers: cjcox, O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1894
2016-11-09 17:47:33 +01:00
Gauthier Ambard
393d6214e0 [CollectionViewCell] Call |layoutSubviews| when editing (#798)
This makes sure that layoutSubviews is called when the editing mode is toggled. Calling layoutSubviews make sure that the edit selector is properly animated when entering and leaving edit mode.
Relates to #701
2016-11-03 11:18:06 -07:00
Louis Romero
12206c44e7 [CollectionCells] Show/hide the editing box as entering/leaving edit
Summary:
This Diff fixes a bug where the edit box on MDCCollectionViewCell did not
show/hide as intended when entering/leaving the edit mode if it does not
trigger |layoutSubviews|.

This closes https://github.com/google/material-components-ios/issues/715.

Test Plan: Check that leaving edit mode does not leave the edit selector visible.

Reviewers: cjcox, O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1723
2016-10-28 11:04:05 +02:00
Ed Chin
9a0804f8ab Fix RTL layout for Collection Cells
Summary:
Properly handle RTL in collection cells with accessory views.

AUTHOR:ed-chin

Test Plan: Tested on pseudortl on iOS 9 simulator

Reviewers: O1 Material components iOS, cjcox

Reviewed By: O1 Material components iOS, cjcox

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1449
2016-08-11 11:44:56 -04:00
Adrian Secord
8c3af252be Adding AUTHORS and removing CONTRIBUTORS.txt.
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has...

Summary:

We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has no legal change, since the contributors always retained their copyright despite the copyright notice, but it's a nice acknowledgement.

Changed copyright statement to include non-Google authors.

Command run:

find * \( -name '*\.m' -or -name '*\.h' -or -name '*\.swift' \) -and -not \( -path 'scripts/external*' -name Pods  \) -print0 | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'

Added non-source files.

Command run:

grep -Rl 'Copyright .* Google Inc' * --exclude-dir scripts/external --null | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'

Reviewers: featherless, O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1415
2016-08-08 08:16:37 -07:00
Sam Morrison
c7aa271784 Various bug fixes for MDCCollectionViewCells
Summary:
Fix editing controls animating on cell when cell scrolls in to view
Fix editing controls being position incorrectly when cell was reused
Fix accessory view cell reuse bugs

Reviewers: cjcox, O1 Material components iOS

Reviewed By: cjcox, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1348
2016-07-26 18:44:39 -04:00
Sam Morrison
10e11da725 Remove ARC guards from MDC
Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1304
2016-07-22 11:38:27 -04:00
Louis Romero
f6d329602f Resize the content view when there is an accessory view.
Summary:
Before:
https://cloud.githubusercontent.com/assets/197492/16435119/08fa6920-3d94-11e6-9d9e-e863f97086b6.png
After:
https://cloud.githubusercontent.com/assets/197492/16435156/383b1090-3d94-11e6-81ef-e7ea0e7baacf.png
(green is the content view, red is the accessory view)

Closes https://github.com/google/material-components-ios/issues/612.

Test Plan:
Open Catalog > Collection Cells > Cell layout example.
Nothing should have changed. Toggling edit should also look exactly the same.

Reviewers: randallli, O1 Material components iOS, cjcox

Reviewed By: randallli, O1 Material components iOS, cjcox

Subscribers: randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1058
2016-06-30 17:08:42 +02:00
Louis Romero
361699fb6c [CollectionCells] Support RTL
Summary:
Cells are now laid out accordingly to their layoutDirection property.
The default value matches the common support across SDKs and OS at runtime.

Closes https://github.com/google/material-components-ios/issues/567

Test Plan:
Set the device or simulator to use an RTL language.
On iOS 9, the UI must be flipped.
On prior OS, the UI is not flipped.

Reviewers: cjcox, iangordon, O1 Material components iOS

Reviewed By: cjcox, iangordon, O1 Material components iOS

Subscribers: brianjmoore

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D962
2016-06-28 17:56:38 +02:00
Adrian Secord
3aedace959 Re-enabled 100-character line limit.
Reviewers: randallli, O1 Material components iOS

Reviewed By: randallli, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D965
2016-06-13 13:34:57 -04:00
Chris Cox
359ac696fa [CollectionCells] Fixes bug preventing removal of accessoryView.
Summary: Closes https://github.com/google/material-components-ios/issues/505

Reviewers: #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D856
2016-05-11 09:39:11 -04:00
Chris Cox
c11e5fce5a [Collections] Updates attributes component API to allow passing the background image view outsets to the cell.
Reviewers: #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Subscribers: lpromero

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D812
2016-05-04 10:38:31 -04:00
Chris Cox
8022c97afa [CollectionCells] Fixes separator width which extended past cell bounds. Closes #448.
Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D796
2016-04-29 13:02:03 -04:00
Chris Cox
7598638db3 [CollectionCells] Updates cells to depend on MDCIcons for editing and accessory icons.
Summary:
- Updates podspec to use these new dependancies.
- Removes private cell resource class.

Reviewers: cjcox, #mdc_ios_owners, featherless

Reviewed By: #mdc_ios_owners, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D751
2016-04-25 12:38:09 -04:00
Chris Cox
f15f6d5db6 [Collections] Merge Collections, CollectionCells, and CollectionLayoutAttributes components.
Summary: Adds Collections, CollectionCells, and CollectionLayoutAttributes components

Reviewers: ajsecord, featherless, randallli, #mdc_ios_owners, iangordon

Reviewed By: randallli, #mdc_ios_owners, iangordon

Subscribers: lpromero, featherless, randallli, iangordon, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D725
2016-04-22 12:04:14 -04:00