28 Commits

Author SHA1 Message Date
Wenyu Zhang
b457b13005 Internal change.
PiperOrigin-RevId: 417635153
2021-12-21 09:32:05 -08:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
92254ea119 Rename all icons to an ic_<#name#> convention.
PiperOrigin-RevId: 308232277
2020-04-24 04:33:51 -07:00
Bryan Oltman
68a65d33d3
[BottomAppBar] Delete deprecated MDCBottomAppBarColorThemer (#9166)
MDCBottomAppBarColorThemer has no internal use and is deprecated.

Fixes #9164
Fixes #9165
2019-12-06 17:10:33 -05: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
featherless
9c8e34138a
[Buttons] Remove all example references to MDCFloatingActionButtonThemer. (#7505)
This is pre-work for being able to annotate MDCFloatingActionButtonThemer as deprecated.

Part of https://github.com/material-components/material-components-ios/issues/5702
2019-06-17 20:59:33 -04:00
Yarden Eitan
efe61588a6
update (#7246)
We need to add @objc annotations to colorScheme and typographyScheme instances in our Swift examples, because we moved to Swift 4.2, the respondsToSelector won't find `setColorScheme:` and `setTypographyScheme:` setters otherwise.
2019-04-23 10:21:14 -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
Wenyu Zhang
ea0986d30c
[BottomAppBar] hide swift example from Catalog. (#6725) 2019-02-28 15:26:10 -05:00
Peter Friese
e1008e5206 [BottomAppBar] Fix it/bottom app bar cut out (#6420)
[BottomAppBar] Fix it/bottom app bar cut out (#5958)

### Context
FABs can be circular or pill-shaped. As described in #5414, the cutout on BottomAppBar does not take into account pill-shaped FABs.

### The Problem
The UIBezierPath used in the current implementation draws a half circle where the FAB appears. For pill-shaped FABS, this doesn't work, as the cutout needs to made up of two quarter circle and a line connecting them.

### The Fix
I implemented a UIBezierPath that is made up of two quarter circles connected by a line, as well as the remainder of the rectangle that makes up the BottomAppBar's background. By doing so, I was able to provide **one** bezier path for both circular and pill-shaped cutouts, and **one** bezier path for a non-cutout version of the rectangle. This results in a smooth animation between the cutout and non-cutout state.

See https://stackoverflow.com/a/9522806 for an explanation of why the cutout and non-cutout bezier paths need to have the same general structure (e.g. number of path elements, and element types).
2019-02-04 11:16:43 -05:00
Cody Weaver
4be982a5c6
[BottomAppBar] Add examples to BUILD file (#6348)
This change is the part of the move to add all examples to BUILD files, this additionally adds the missing imports in the examples.
Closes #6223
2019-01-16 09:51:13 -05:00
Yarden Eitan
e30327f8a7 Revert "[BottomAppBar] Fix it/bottom app bar cut out (#5958)"
This reverts commit 068786a9c620e6e760b8f30d414067b1da203808.
2019-01-08 14:59:06 -05:00
Peter Friese
068786a9c6 [BottomAppBar] Fix it/bottom app bar cut out (#5958)
### Context
FABs can be circular or pill-shaped. As described in #5414, the cutout on BottomAppBar does not take into account pill-shaped FABs.

### The Problem
The UIBezierPath used in the current implementation draws a half circle where the FAB appears. For pill-shaped FABS, this doesn't work, as the cutout needs to made up of two quarter circle and a line connecting them.

### The Fix
I implemented a UIBezierPath that is made up of two quarter circles connected by a line, as well as the remainder of the rectangle that makes up the BottomAppBar's background. By doing so, I was able to provide **one** bezier path for both circular and pill-shaped cutouts, and **one** bezier path for a non-cutout version of the rectangle. This results in a smooth animation between the cutout and non-cutout state.

See https://stackoverflow.com/a/9522806 for an explanation of why the cutout and non-cutout bezier paths need to have the same general structure (e.g. number of path elements, and element types).
2019-01-07 17:06:13 -05:00
Robert Moore
c1b1d25eec
[MDC Swift] Add guards for Swift 4.2+ (#5634)
[MDC Swift] Add guards for Swift 4.2+

On Xcode 10, using Tulsi, the unit test target cannot be built because much of the Swift code does
not have the correct syntax for Swift 4.2+. Adding pragmas to allow continued support for Xcode
9.4.2 and Xcode 10.

PiperOrigin-RevId: 220399935
2018-11-07 08:54:40 -05:00
Robert Moore
378f90dc6e
[BottomAppBar]! Examples use semantic color scheme. (#5070)
The BottomAppBar now supports the "surface variant" of the Material
theming color themers. The examples should be updated to reflect the
correct styling for Material Theming.

**This is a breaking change that will break internal MDC Catalog screenshot tests.**

|Example|Before|After|
|--|--|--|
|Catalog (Objc)|![bab-objc-catalog-before](https://user-images.githubusercontent.com/1753199/45260529-566ae300-b3b8-11e8-95c8-a258bf95c3ca.png)|![bab-objc-catalog-after](https://user-images.githubusercontent.com/1753199/45260530-5b2f9700-b3b8-11e8-993d-449eb1c4c47e.png)|
|Dragons (Objc)|![bab-objc-dragon-before](https://user-images.githubusercontent.com/1753199/45260532-6256a500-b3b8-11e8-961e-106da28a3db2.png)|![bab-objc-dragon-after](https://user-images.githubusercontent.com/1753199/45260535-67b3ef80-b3b8-11e8-8f03-b2c808ec9b86.png)|
|Dragons (Swift)|![bab-swift-dragon-before](https://user-images.githubusercontent.com/1753199/45260537-6f739400-b3b8-11e8-8796-b94779018b63.png)|![bab-swift-dragon-after](https://user-images.githubusercontent.com/1753199/45260762-88327880-b3bd-11e8-9896-be55dd96d515.png)|

Part of #3928
2018-09-10 18:31:28 -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
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
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
featherless
d4f727e16f
[Buttons] Add umbrella headers for all extension targets. (#3454)
Also updated all imports to make use of the umbrella headers.

Pivotal story: https://www.pivotaltracker.com/story/show/157045283
2018-04-24 11:36:56 -04: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
c3f9fbd429 [BottomAppBar] Corrected imports in examples. (#2656)
PiperOrigin-RevId: 178291407
2017-12-08 23:46:17 -05:00
Junius Gunaratne
fbbab80570 Implement viewSafeAreaInsetsDidChange (#2466) 2017-11-17 09:13:07 -05:00
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -04:00
Junius Gunaratne
9f44d52984 Update bottom app bar for iPhone X (#2234) 2017-10-23 12:04:23 -04:00
Adrian Secord
479f7b1141 Remove trailing whitespace everywhere. (#2168) 2017-10-13 11:33:35 -04:00
Junius Gunaratne
49e4ae74c6 [BottomAppBar] Add readme and Swift example (#2040)
* Add readme and swift example

* Use autoresize mask for layout

* Use autoresize mask for layout

* Add links in .md file. Apply swift code style.

* Update color example code
2017-10-03 14:59:21 -04:00