37 Commits

Author SHA1 Message Date
Jeff Verkoeyen
ec44b12ee9 Internal change
PiperOrigin-RevId: 394725753
2021-09-03 11:44:01 -07:00
Jeff Verkoeyen
b3fa42005b Optimizing imports
PiperOrigin-RevId: 356966407
2021-02-11 07:12:37 -08:00
Jeff Verkoeyen
fbb1f20aa2 Internal change
PiperOrigin-RevId: 332151481
2020-09-16 21:01:21 -07:00
Bryan Oltman
655604fe58
[Catalog] Delete non-functional ShadowElevationsTypicalUseViewController.swift (#8955) 2019-11-15 14:38:47 -05:00
featherless
74f6530d15 [ShadowElevations] Provide semantic VoiceOver labels when interacting with the typical use example. (#8930)
Before this change, VoiceOver would announce the slider's percentage value as the value changed up and down.

After this change, VoiceOver will announce the select shadow elevation name, if available, otherwise it will announce a fallback string with the selected shadow elevation.

Fixes #8927
2019-11-15 10:31:24 -08:00
featherless
5425884431
[examples] Annotate all catalogShouldHideNavigation invocations with @objc. (#8791)
Context:

Due to changes in the Swift runtime over the past years, methods that are considered "optional" in Objective-C need to have @objc annotations in order for Objective-C to be able to perform `respondsToSelector:` invocations.

Problem:
Many of our examples had not annotated their `catalogShouldHideNavigation` methods with the `@objc` annotation, causing the Catalog to wrap the examples in a container app bar view controller. The reason most of these examples would implement `catalogShouldHideNavigation` is because they are managing their own navigation (e.g. to demonstrate AppBar functionality), so this would often result in duplicate AppBars appearing in the example.

The fix:
All `catalogShouldHideNavigation` Swift methods have been annotated with `@objc`.

Fixes https://github.com/material-components/material-components-ios/issues/7576
Fixes https://github.com/material-components/material-components-ios/issues/7578
2019-11-12 16:54:55 -05: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
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
Wenyu Zhang
5986e38b84
[Catalog] Avoid cropping on the ShadowLayer example (#4884)
cropped on small device; fix the topLayout issue (the top label covered by the app bar)

closes (https://github.com/material-components/material-components-ios/issues/386)


Before the change:
![simulator screen shot - iphone 5 - 2018-08-24 at 10 18 58](https://user-images.githubusercontent.com/8836258/44589752-59928c00-a787-11e8-8f21-1f56b180c3d5.png)
![simulator screen shot - iphone 5 - 2018-08-24 at 10 18 53](https://user-images.githubusercontent.com/8836258/44589747-57c8c880-a787-11e8-91ea-7b529c6c2835.png)



After the change:
![simulator screen shot - iphone 5 - 2018-08-24 at 10 20 18](https://user-images.githubusercontent.com/8836258/44589762-61523080-a787-11e8-99b4-c39828d52d07.png)
![simulator screen shot - iphone 5 - 2018-08-24 at 10 20 22](https://user-images.githubusercontent.com/8836258/44589765-62835d80-a787-11e8-8ce6-2316176b71a5.png)
2018-08-30 16:11:33 -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
Robert Moore
8aeb618d1a
{Swift} Fix remaining imports (#4792)
A few straggling imports were missing when building internally.
2018-08-14 16:44:21 -04:00
Robert Moore
175942d9e0
[Catalog] Fix Swift example imports (#4780)
Many of our Swift examples are either missing imports or are importing all of
MaterialComponents. Both of these will cause failures during internal builds.
2018-08-14 13:26:37 -04:00
Robert Moore
ac038bf996
[ShadowElevations] Rewrite ShadowElevationsPointsLabel in Swift (#4782)
Avoids having Swift examples depending on Objective-C examples and improves
internal build cleanliness.

Partially fixes #4781
2018-08-14 10:59:07 -04:00
featherless
50e1fd091d
[Catalog] Conversion to new App Bar View Controller API (#4696)
This PR updates the catalog to use the new MDCAppBar API throughout.
2018-08-07 09:30:37 -04:00
Randall Li
f6e04eb72c [Shadow Elevation] Changed slider to be discrete to make it more clear that the named labels are for specific values of the slider. (#3741)
https://www.pivotaltracker.com/story/show/157297961
2018-05-07 19:56:13 -04:00
featherless
23110ef116
[Catalog] Make all swift copycat demos be dragons. (#3443)
Also removed "(Swift)" from any examples that remained as non-dragons. The catalog does not need to advertise which language a given demo is in.

Pivotal story: https://www.pivotaltracker.com/story/show/156939611

## Screenshots

Before:
![simulator screen shot - iphone se - 2018-04-23 at 14 04 14](https://user-images.githubusercontent.com/45670/39144588-36095450-46ff-11e8-868d-bdb7e8ee5438.png)

After:
![simulator screen shot - iphone se - 2018-04-23 at 13 53 39](https://user-images.githubusercontent.com/45670/39144567-2ad7bf9a-46ff-11e8-9fd5-ef0739d427b3.png)
2018-04-24 15:52:13 -04:00
Ian Gordon
5b8067327e Revert "[Shadows] Deprecate MDCShadowElevationSwitch"
This reverts commit 30acb85b679693bbc4f1896c2185c730e346807f.
2018-01-02 17:14:00 -05:00
Ian Gordon
30acb85b67 [Shadows] Deprecate MDCShadowElevationSwitch 2018-01-02 17:10:02 -05:00
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
Randall Li
2f29f00d86 Fixed some compiler warnings (#2426)
* Added warnings to examples.

* fixed some warnings

* using button sender parameter.

* use button sender in example

* use button sender in example

* removed sender from methods that don’t use it.

* removed sender from methods that don’t use it.

* use button sender in example

* use button sender in example

* use button sender in example

* use button sender in example

* Fixed init of header configurator to use passed in parameter

* removed unused API

* use button sender in example

* Revert "Added warnings to examples."

This reverts commit 91f0480f86cb609c47b00f1346f82de67c31c4e9.

* fixed example: Using the view controllers navigationItem rather than creating a new one.

* removed finished checks from animation blocks in examples.

* reverted id sender checks

* revert id sender check for Flexible header UINavigationBar

* revert clug

* revert clug

* addressing nits

* removed sender check for FeatureHighlightTypicalUseView

* more nits
2017-11-22 10:51:55 -05:00
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -04:00
Martin Petrov
6639fb4f70 Update shadow examples (#2174) 2017-10-13 13:07:31 -04:00
Adrian Secord
479f7b1141 Remove trailing whitespace everywhere. (#2168) 2017-10-13 11:33:35 -04:00
Adrian Secord
960ec4a823 Partial revert of commit bc582f4 to restore the definition of MDCShadowElevationSwitch
.
2017-10-10 10:54:44 -04:00
Junius Gunaratne
a9b08ce452 [ShadowElevations] Improve Swift support for shadow elevations (#2116)
* Shadow elevation swift

* Improve shadow elevation swift support

* Add const. Update formatting.
2017-10-06 15:01:41 -04:00
Junius Gunaratne
bc582f4b14 [MDCShadowElevations] Remove switch elevation, add bottom navigation bar elevation (#2093)
* Add bottom nav bar elevation, remove switch elevation.

* Remove switch elevation from example.
2017-10-05 14:37:28 -04:00
Robert Moore
8940d77d6d [Catalog] Verify all examples provide CatalogByConvention methods (#1911)
All examples now have at least the required `+catalogBreadcrumbs` and `+catalogIsPrimaryDemo`.  All examples in the same breadcrumbs path have only one primary demo.  There should be only one `-catalogDescription` attached to the primary demo.

Closes #1897
2017-08-31 08:46:10 -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
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
Junius Gunaratne
b8dc78d58c [Catalog and Shadow] Group shadow elevations with shadow demos
Reviewers: featherless, ajsecord, #mdc_ios_owners, randallli

Reviewed By: #mdc_ios_owners, randallli

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D637
2016-04-19 09:26:33 -04:00
Will Larche
2ab08f4133 [Catalog & Examples] Added navigationBar example in Swift (Supplemental POC) and corrected slight mistake in Catalog by Convention logic.
Summary: Merge branch 'develop' of https://github.com/google/material-components-ios into develop

Reviewers: ajsecord, featherless, #mdc_ios_owners

Reviewed By: ajsecord, featherless, #mdc_ios_owners

Subscribers: featherless, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D587
2016-04-13 14:56:49 -04:00
Jeff Verkoeyen
8416f8e540 Ran arc lint --everything --apply-patches.
Summary: Ran with clang-format 3.9.0.

Reviewers: #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D534
2016-04-08 11:35:37 -04:00
Junius Gunaratne
0411613c71 [Catalog] Demo selection screen updated with description and primary demo
Summary: Screenshot http://codereview.cc/M13

Reviewers: featherless, jstriegel, ajsecord, #mdc_ios_owners

Reviewed By: jstriegel, ajsecord, #mdc_ios_owners

Subscribers: ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D514
2016-04-07 16:45:52 -04:00
Junius Gunaratne
f4f89c2145 [ShadowElevations] Add shadow elevations demo to catalog
Summary: Screenshot: http://codereview.cc/M10

Reviewers: featherless, ajsecord, #mdc_ios_owners

Reviewed By: featherless, ajsecord, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D486
2016-04-05 14:49:59 -04:00