52 Commits

Author SHA1 Message Date
Nobody
58f6375b10 Internal change
PiperOrigin-RevId: 565513516
2023-09-14 16:45:39 -07:00
David Collazo
6ab378ddc4 Remove deprecated enableRippleBehavior property from BottomNavigation component
PiperOrigin-RevId: 441893309
2022-04-14 17:19:57 -07:00
Wenyu Zhang
b457b13005 Internal change.
PiperOrigin-RevId: 417635153
2021-12-21 09:32:05 -08:00
Jeff Verkoeyen
86a8c97dc7 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400788645
2021-10-04 12:41:07 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
ec44b12ee9 Internal change
PiperOrigin-RevId: 394725753
2021-09-03 11:44:01 -07:00
Cody Weaver
28165af3fe Internal change
PiperOrigin-RevId: 392913717
2021-08-25 09:30:48 -07:00
Jeff Verkoeyen
b3fa42005b Optimizing imports
PiperOrigin-RevId: 356966407
2021-02-11 07:12:37 -08:00
Cody Weaver
8da92053bd [Shadows] Add example for performance testing.
PiperOrigin-RevId: 352023777
2021-01-15 09:28:16 -08:00
Jeff Verkoeyen
eb82984224 Internal change
PiperOrigin-RevId: 331764642
2020-09-15 07:31:56 -07:00
Cody Weaver
69e8021b2a
[Shadow] Make Shadow Corner Radius example more accessible. (#8962)
This updates the Shadow Corner Radius example to be more accessible by adding accessibility label and hint to the slider in this example.

Closes #8928
2019-11-15 13:39:43 -08: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
Ian Gordon
7a6a862c0a Re-enable ShapeLibrary where required 2019-02-07 16:52:45 -05:00
Ian Gordon
e61e89a592 Fix podspec validation issues 2019-02-07 16:31:09 -05: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
Cody Weaver
39e8848019
[ShadowLayer] Add examples to BUILD file (#6331)
Closes #6240
2019-01-16 07:45:36 -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
Cody Weaver
a0810b5746
[ShadowLayer] Add API to animate corner radius (#5585)
### Context
A client is wanting to animate the corner radius of a view that has a `MDCShadowLayer` backing layer. This currently doesn't render correctly. The work done in #5398 still does not support animating the corner radius. #5398 additionally doesn't animate the `shadowPath` property so it still won't work properly. We set the properties in the `CATransaction completionBlock` because this prevents the layer from snapping back to it's original state after the animation completes. If a client desires to use a `CATransaction` wrapper around this animation they can do so as outlined [here](https://developer.apple.com/documentation/quartzcore/catransaction).
### The problem
Animating corner radius changes in a CAAnimation don't render
### The fix
Add an API to allow clients to animate corner radius changes for MDCShadowLayer.
### Alternatives
1. Alternatives to adding a new API would be to have the a client use our private API which isn't desirable and not future proof as discussed in #5566.

2. Add an API `- (CAGroupAnimation *)animateCornerRadius:(CGFloat)cornerRadius;` that would return all 5 of the animations and clients could set the duration and timingFunction themselves but this doesn't allow for the layers to stay animated after completion. If we want the layer to be animated after completion we could use `kCAFillModeForwards` and `removeOnCompletion = NO` but that would prevent use from animating back to the original state.
### Videos
| Before | After |
| - | - |
|![before](https://user-images.githubusercontent.com/7131294/47959028-d1fba180-dfaf-11e8-99fb-3aedd0a5010e.gif)|![after](https://user-images.githubusercontent.com/7131294/47959029-d6c05580-dfaf-11e8-97c4-68a46bbd4c7f.gif)|

| Alternative 2 | Without corner radius |
| - | - |
|![group](https://user-images.githubusercontent.com/7131294/47959034-eb9ce900-dfaf-11e8-8c92-18e668aeb21d.gif)|![nocornerradius](https://user-images.githubusercontent.com/7131294/47959036-ef307000-dfaf-11e8-83eb-dee49d2de36a.gif)|

### Bugs remaining
1. Set the MDShadowLayer cornerRadius to 0.
2. Call the new API with a duration of 5 seconds and a cornerRadius of 10.
3. Before that animation completes call the API again with a cornerRadius of 0.
#### Expected behavior
The first animation would complete and then the second animation would start.
#### Actual behavior
The animation jumps to 10 and then animates back to 0.

**_note_** This could be avoided if we added a property `BOOL` called `_isAnimating` and if that is set to `YES` then we would stash the next animation. This isn't added because most animations will be too fast for a user to tap that fast.

### Tested
cl/219964460
2018-11-05 18:25:43 -05:00
Cody Weaver
3c636c1704
[ShadowLayer] Subclass UIView in corner radius example (#5388)
### Context
In working on #4848 I noticed that the example uses an UILabel which may have a different backing layer (possibly CATextLayer) than UIView. This change makes it easier for another team member to address this issue.
### The fix
Subclass UIView which I believe is the most common use case for using a custom shadow layer in this example.
### Related issue
#4848
### Videos
| Before | After |
| - | - |
|![develop](https://user-images.githubusercontent.com/7131294/46751924-efc43800-cc89-11e8-8327-b05f6bb5f3f3.gif)|![shadowafter](https://user-images.githubusercontent.com/7131294/46751933-f357bf00-cc89-11e8-9e17-eea6dd0dd7bd.gif)|
2018-10-10 13:33:15 -04:00
featherless
d706762315
[ShadowLayer] Fix layout of shadow layer example. (#5222)
It now respects the top layout guide of the app bar.

| Before | After |
|--------|-------|
| ![simulator screen shot - iphone 8 plus - 2018-09-24 at 23 19 06](https://user-images.githubusercontent.com/45670/45976735-40178500-c050-11e8-9128-e581436dbb50.png) | ![simulator screen shot - iphone 8 plus - 2018-09-24 at 23 18 17](https://user-images.githubusercontent.com/45670/45976719-368e1d00-c050-11e8-8885-212dd34d9dd1.png) |
2018-09-25 16:54:20 +03: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
ianegordon
cc3c77866f
[ShadowLayer] Add dragon demonstrating cornerRadius changes aren't rendering (#4849)
* [ShadowLayer] Dragon demonstrating that corner radius isn't updated.
2018-08-22 17:43:19 -04:00
Yarden Eitan
d1767c0086 [Shapes] [ShadowLayer] Example using Shapes and Shadows with animation (#3394)
* uiview with shadow and shape

* example using shape and shadow

* example using shape and shadow

* spacing
2018-04-18 22:08:32 -04:00
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
featherless
e38ac60ffd
[ShadowLayer] Add support for implicitly animating the shadow layer's elevation using MotionAnimator. (#2509) 2017-11-22 16:16:57 -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
Martin Petrov
49fd0a07ea [ShadowElevations] Update ShadowElevations to be extensible. (#2145)
* [Collections] Modernize Swift in styling readme.

* [ShadowElevations] Update ShadowElevations to be extensible.

This defines a custom macro to get the typed enum behavior rather than
defining a system macro to prevent it from adversily affecting clients.

Redundant NS_SWIFT_NAME macros are removed.

Usage is updated to omit the optional rawValue: argument. Docs are also
updated to reflect the change.

* minor fixes

* need an extra clause for xcode8

* updated for xcode8 backwards compat
2017-10-13 11:36:31 -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
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
Martin Petrov
1e14d41091 Explicitly annotating some known ObjC methods. (#1617)
This improves Swift4 compatibility, see:
https://help.apple.com/xcode/mac/current/#/deve838b19a1
2017-07-10 19:46:22 -04:00
Adrian Secord
8bcb19781c More SwiftLint fixes for unit tests and example apps. (#1154)
* ClangFormat changes.

* Added swiftlint to scripts/format_all.`

* Fix scripts/lint_all to work from any directory.

* Fixed swiftlint invocation.

* Remove the checks for force casting (! operator).

* Some fixes.

* More Swift fixes.
2017-01-11 13:27:57 -05:00
Sam Symons
bb561ac257 [Scripts] SwiftLint integration (#1129)
* Integrate SwiftLint in the Catalog.

* Update the disabled SwiftLint rules.

* Reference a local swiftlint.yml symlink.

This prevents us from getting warnings about code style violations from the other demos.

* Fix SwiftLint violations in the Catalog and Components.

* Ignore the `third_party` directory when running the linter.

We should not have to deal with warnings in code we may not be able to fix easily.

* Integrate SwiftLint into Shrine.

Additionally, fix a number of warnings introduced.

* Run SwiftLint on Travis.

* Enable many of the previously disabled rules and correct them.

* Fix control statement violations from SwiftLint.
2017-01-06 16:37:23 -05:00
ianegordon
0f422df49a [Typography] Remove Font Loaders (#1035)
* [Typography] Remove Font Loaders

* Unit test cleanup

* Update storyboards
2016-12-13 23:37:19 -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
4842a362f5 Convert component examples to Swift 3 (#1002)
* WIP

* WIP

* Simplified build script and fixed it to build all schemes.

* WIP

* Renamed script to build_all and added better output.

* Add scripts/list_xcode_workspaces.

* Filtered out the CocoaPods schemes.

* Use Xcode to update Swift to v3.

* Updated tracked touches map from NSNumber to Int.

* Fixed button sorting that was not actually sorting.

* targetContentOffset no longer allowed to be nil.

* "Fixed" failing test by reducing random number range?

* Swift 3 syntax change.

* Swift 3 syntax change.

* Removed invalid center-aligning tests.

Fixed default nav bar alignment test.
2016-12-12 09:55:36 -05: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
65a05eed31 Lowercase "material design" in text.
Summary: "Material design" is not capitalized except when referring to the actual Material Design team at Google.

Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Subscribers: randallli, featherless

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1306
2016-07-25 14:13:08 -04:00
Eric Li
25ea19e76a updated examples and readme to use new swift selector syntax
Summary:
Updated project to use new swift #selector syntax

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

Reviewers: featherless, O1 Material components iOS

Reviewed By: featherless, O1 Material components iOS

Subscribers: featherless

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D938
2016-06-06 15:43:37 -04:00
Jeff Verkoeyen
21d5cf1d04 Global find-and-replace of 'kMDC' with 'k'.
Summary: Closes https://github.com/google/material-components-ios/issues/435.

Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D759
2016-04-26 15:20:18 -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
Junius Gunaratne
7bb181a150 [Catalog] Make catalogIsPrimaryDemo static method in demos
Reviewers: ajsecord, #mdc_ios_owners, featherless

Reviewed By: #mdc_ios_owners, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D611
2016-04-15 09:31:51 -04:00
Junius Gunaratne
f63da17233 [Catalog] Update shadow layer demo color
Reviewers: ajsecord, featherless, #mdc_ios_owners

Reviewed By: featherless, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D590
2016-04-13 10:33:56 -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
Jeff Verkoeyen
61a895c5b1 [Catalog] Rename catalogHierarchy to catalogBreadcrumbs.
Reviewers: junius, #mdc_ios_owners

Reviewed By: junius, #mdc_ios_owners

Subscribers: junius

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D448
2016-04-01 12:40:17 -04:00
Junius Gunaratne
b1abd0ece9 [Catalog] Update colors to blue branding color
Reviewers: ajsecord, #mdc_ios_owners, featherless

Reviewed By: #mdc_ios_owners, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D335
2016-03-24 15:26:10 -04:00
Jeff Verkoeyen
a75756fc0d Moving assets into catalog by convention.
Reviewers: #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D237
2016-03-10 10:45:44 -05:00
randallli
5a16612612 [MDCShadowLayer] Refactored example to be compatible with catalog by convention.
Summary: This is a swift example

Reviewers: featherless, #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D220
2016-03-08 14:28:22 -05:00
randallli
6182b641a5 Added code signing setting to be able to run on device.
Test Plan:
Open an example project
Build and run on device.
It should run without codesigning erros.

Reviewers: junius, featherless, #material_components_ios_owners

Reviewed By: featherless, #material_components_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D103
2016-02-05 12:41:44 -05:00