32 Commits

Author SHA1 Message Date
Jeff Verkoeyen
92254ea119 Rename all icons to an ic_<#name#> convention.
PiperOrigin-RevId: 308232277
2020-04-24 04:33:51 -07:00
Jeff Verkoeyen
5957dd223a [Lists] Use standard "List Items" name for all Lists examples.
The CollectionListCellExampleTypicalUse was using "Lists" as its top-level breadcrumb instead of "List Items", which was causing it to appear in its own category in the catalog. This does not appear to be intentional, so this change aligns the example with the component's conventional name.

PiperOrigin-RevId: 306422785
2020-04-14 06:01:11 -07:00
Galia Kaufman
36f6a30fa6
[List] Removing MDCListThemer (#9187)
Removing MDCListThemer from within our library.
2019-12-09 19:49:21 -05:00
Robert Moore
90fcc9281a [ListItems] Make Base Cell example more accessible. (#8982)
Provides accessibility labels and distinguishing colors for each cell. Voice
Over users can now scroll the example.

Closes #8898
2019-11-18 08:29:05 -05:00
Cody Weaver
f660c8a732
[List] Fix catalog compile issue (#8974)
This fixes a compile issue within the catalog where we were accidentally formatting a string wrong.

NO_BUG=Fast follow on #8953
2019-11-15 13:55:09 -08:00
Robert Moore
009af8be81 [List] Make Base Cell example more accessible. (#8947)
Allows for interaction using Voice Over and Switch Control.

|Before|After|
|---|---|
|![IMG_0100](https://user-images.githubusercontent.com/1753199/68967740-e96a8e80-07ae-11ea-8309-7abb3baa9b39.PNG)|![IMG_0101](https://user-images.githubusercontent.com/1753199/68967753-f5565080-07ae-11ea-88bc-bb18e1ef0bcf.PNG)|



Part of #8898
2019-11-15 16:13:06 -05:00
Galia Kaufman
722399ddce
[MDC Dragons] Fix MDCBaseCell Example to work with Voice Over (#8953)
Make sure List cells are accessible to Voice Over and have a label that distinguish them from each other, and have the selected trait when selected.
2019-11-15 15:27:26 -05:00
Bryan Oltman
c89ac31d2b
[Catalog] Fix accessibility labels and layout in CollectionListCellExampleTypicalUse (#8944)
* [Catalog] Fix accessibility labels and layout in CollectionListCellExampleTypicalUse

* clang
2019-11-15 14:06:08 -05:00
Yarden Eitan
b9ad888e6d
[List] Adds the Ripple behavior to List. (#7591)
## Related links
* Bug: Closes #7380 
* Ripple: [MDCRippleView](https://github.com/material-components/material-components-ios/tree/develop/components/Ripple)

## Introduction
This PR integrates [`MDCRippleView`](https://github.com/material-components/material-components-ios/blob/develop/components/Ripple/src/MDCRippleView.h) into [`MDCBaseCell`](https://github.com/material-components/material-components-ios/tree/develop/components/List). This behavior is an opt in flag property added to MDCBaseCell, `enableRippleBehavior`.  This improves the visual touch feedback for our users as MDCInkView didn't support our current motion guidelines. We are also marking any of the Ink APIs ToBeDeprecated as part of the [Deprecation Policy](cb6b8e9599/contributing/deprecation_policy.md (step-4-add-a-comment-to-the-api-indicating-that-it-will-be-deprecated)).

## Videos
| Before | After |
| - | - |
|![oldRipple](https://user-images.githubusercontent.com/4066863/59466835-43c88300-8dfc-11e9-9867-f97d48c5f7d2.gif)|![newRipple](https://user-images.githubusercontent.com/4066863/59466842-462add00-8dfc-11e9-8e69-b0e2602568de.gif)|
2019-06-15 14:32:48 -04:00
Andrew Overton
c56d5d76d3
Add @objc annotations to get examples to show up in Dragons (#7168)
This is a follow up PR for #7166 adds @objc annotations to Swift catalogMetadata() methods, because the Swift 4 compiler no longer attempts to infer what methods should be visible to Objective-C. As a result of this change in the compiler, no Swift examples were showing up in Dragons after #7166. See this article: https://useyourloaf.com/blog/objc-warnings-upgrading-to-swift-4/ for additional context.
2019-04-17 21:35:43 -04:00
Andrew Overton
b38372192f
Update to Swift 4.2 (#7166)
This PR updates the Swift version to 4.2.

Partially resolves #6874.
2019-04-17 16:59:02 -04: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
Yarden Eitan
2803125b2c
ran clang-format (#6027) 2019-01-11 13:23:51 -05:00
Robert Moore
03f3351ad5
Global replace of single-precision floats with CGFloat casts. (#5718)
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat.  For example, `0.1f` should become `(CGFloat)0.1`.

Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```

PiperOrigin-RevId: 220683126
2018-11-12 10:50:01 -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
Robert Moore
410f2f55e7 [List Items] Improve BiDi example performance. (#5506)
The example showing how to use MDF Internationalization's language
direction code was somewhat inefficient, calling the method twice on the
same string. Instead it should be called once and the result checked.

In manual testing, dropped overhead from 0.8% of Main Thread time to
0.4% while scrolling the example.
2018-10-24 19:05:12 -04:00
Andrew Overton
49b29af661
Use ListThemer for List example (#5502)
## The problem:

The Stereo cell example wasn't using the List Themer.

## The solution:

Make the Stereo cell example use the List Themer.

I didn't include before and after screenshots because there is no visual change.

Closes #5501.
2018-10-24 15:55:50 -04:00
Andrew Overton
d1961ea5d7
Add RTL arabic text to list example (#5500)
## The problem:

There wasn't any RTL text in our List example!

## The solution:

I added some RTL text to our List example.

Closes #5498

### Before:
![simulator screen shot - iphone x - 2018-10-23 at 11 28 37](https://user-images.githubusercontent.com/8020010/47372425-bb07a600-d6b7-11e8-997f-ba19d17dc85b.png)

### After:
![simulator screen shot - iphone x - 2018-10-23 at 11 28 02](https://user-images.githubusercontent.com/8020010/47372426-bb07a600-d6b7-11e8-86b1-e088a8737102.png)
2018-10-23 16:52:33 -04:00
Robert Moore
12773d3289
[List] Fix example import. (#5426)
Examples should import umbrella headers, not individual classes.
2018-10-15 16:27:06 -04:00
Julien Poumailloux
d55b6bb37f [List] Fix MDCSelfSizingStereoCell not using the right text color and not resetting all label properties on re-use (#5341)
There were two issues:
1) the -titleLabel and -detailLabel UILabels were not getting their -textColor set, despite the helper methods -defaultTitleLabelTextColor and -defaultDetailLabelTextColor defined in the file.
2) within -prepareForReuse, the -textColor and -numberOfLines properties on the -titleLabel and -detailLabel UILabels weren't getting reset.
2018-10-08 14:22:35 -04:00
Andrew Overton
d554709099
[List] Generalize List themers (#5357)
These changes generalize List themers so that for the List component there is one themer per subsystem, each with one method per List Item class.

Closes #5356
2018-10-08 13:02:45 -04:00
Andrew Overton
0aabda44b3
Add MDCSelfSizingStereoCellColorThemer (#5311)
Add ColorThemer to MDCSelfSizingStereoCell. Closes #5303.
2018-10-03 15:16:41 -04:00
Andrew Overton
0fb7ec9712
[List] Add TypographyThemer to MDCSelfSizingStereoCell (#5298)
* Add TypographyThemer to MDCSelfSizingStereoCell

* Appease clang format

* Update BUILD file

* Fix copy/paste typo
2018-10-03 11:36:38 -04:00
Andrew Overton
cf09971831
[List] Add Self Sizing Stereo Cell (#4953)
* Four prototypes: (#4382)

Two have manual layout and two have auto layout.
Two have configurable supporting views, two don't.

* Manual Layout prototype 3

* Fix project by adding initial List Item Cell Demo

* Add other List Item example

* Make view properties readonly and make cellWidth private

* Make cellWidth public again and make more efficient

* Rename MDCListItemCell to MDCBasicStereoCell

* Rename to MDCSelfSizingStereoCell

* Small nits

* Set cellWidth in preferredLayoutAttributes

* Some Jeff feedback

* Extract layout code

* Delete all the prototypes from forever ago

* Fix copyright messages

* Get rid of __IPHONE_11_0 checks

* PR feedback

* Move layout to its own file

* Add dependencies

* Tweak documentation

* Fix copyright stanzas

* Clang format

* Move numberOfLines logic to cell
2018-09-04 11:34:56 -04: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
Yarden Eitan
3480c50c67
updated to newest CbC standard (#4956)
Move to the new CbC standard released in CatalogByConvention v2.5.0. See PR: material-foundation/cocoapods-catalog-by-convention#27 for more info on the change.
2018-08-29 20:45:13 -04:00
featherless
bbe4a23fe0
Remove all __IPHONE_11_0 checks now that we no longer support Xcode 8. (#4915)
We can now make use of @available throughout our codebase.

We support Xcode 9 and up, which includes the iOS 11 SDK. This means we can remove any guards for SDKs prior to iOS 11.

This was cleaned up by running a global find-and-replace with the following regular expression:

```
Find:#if defined\(__IPHONE_11_0\) && \(__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0\)\n(.+if \(@available\(iOS 11.0, \*\)\) \{(?:.|\n)*?)(?:#else(?:.|\n)*?)?\n#endif
Replace:$1
```

With some additional cleanup for stragglers that didn't match this pattern. Note that else clauses were intentionally dropped.

Closes https://github.com/material-components/material-components-ios/issues/4909
2018-08-28 09:57:30 -04:00
Robert Moore
b917bf24d6
[List] [MaskedTransition] Fix Swift imports (#4828)
So that the examples will compile
2018-08-17 16:13:06 -04:00
Andrew Overton
4b6eb9430c
[ListItems] Add Base Cell With Example (#4461)
This PR adds the MDCBaseCell with an accompanying example and readme.
2018-07-10 15:48:25 +02:00
Yarden Eitan
11d02c2b44
[Lists] fix analyze warnings from example (#4188)
* fix analyze warnings
2018-05-17 18:00:29 -04:00
Yarden Eitan
4340ccda18
[List] Updated the List README to incorporate the example (#3698)
Updated README

Removed unneeded lines from example.
2018-05-03 17:53:50 -04:00
Yarden Eitan
e81453a1a0
[Lists] Added initial example for implementing the List component (#3646)
Pivotal: https://www.pivotaltracker.com/story/show/155597168

This example uses auto layout constraints to show a way to use UICollectionViewCells with a vanilla UICollectionViewController to achieve a List Cell that is self-sizing, supports dynamic type, RTL, and orientation changes.

This example also supports the correct layout with and without an image set in the cell, and also with an unset titleLabel.text and an unset detailsLabel.text.
2018-05-02 20:24:42 -04:00