18 Commits

Author SHA1 Message Date
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
Wenyu Zhang
7d33f7597e
[Math] added MDCCeilScaled and MDCFloorScaled (#1917) (#4867)
closes #1917
2018-08-23 12:32:55 -04:00
Robert Moore
04ca713388
[Math] Fix CGFloat errors in tests. (#4858)
An internal build failed (once) when compiling the Math tests because
double-precision floating point
values were being implicitly cast to single-precision. Marking each of these
as either single-precision float or CGFloat (where convenient). Except for the
tests that measure rounding errors, single- and double-precision isn't
important for the test outputs.

Sample error:

material_components_ios/components/private/Math/tests/unit/MDCMathTests.m:33:38: error: implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float') [-Werror,-Wconversion]
  CGRect misalignedRect = CGRectMake(0.45, 0.78, 1.01, 5.98);
                          ~~~~~~~~~~ ^~~~
2018-08-21 09:10:27 -04:00
Robert Moore
f1bb92ee92 [BottomNavigation, Math] Fix BOOL types (#4436)
Two files were using C99 `bool` instead of Objective-C `BOOL` types. This
could lead to breakages in the future if the `BOOL` type were redefined by the
Objective-C headers.
2018-06-26 13:42:22 -04:00
Sam Morrison
c63eeafda4
[Chips] Pixel align subviews (#2739)
* [Chips] Pixel align subviews

* Document MDCSizeCeilWithScale

* Scale arg
2017-12-19 16:23:36 -05:00
Will Larche
1bd5590bbb
[Kokoro] Support for TextFields, Math, and Typography (#2432)
* [TextFields] Kokoro work.

* [Math] Imports needed for kokoro.

* [Kokoro] Support for MDCMath.

* [TextFields] Alphabetizing.

* [Kokoro] Formatting.

* [Kokoro] Formatting
2017-11-16 22:25:52 -05:00
featherless
5c87a3fd9a
[BottomSheet] Add BUILD file for kokoro + bazel support. (#2396)
* [BottomSheet] Add BUILD file for kokoro + bazel support.

I will be sending out a variety of pull requests soon to the bottom sheet. Adding the component to kokoro will let the PRs land more quickly.

* Remove unused load statements.
2017-11-10 17:35:16 -05:00
Sam Morrison
663120a830 Shapes (#2086) 2017-10-04 15:29:06 -04:00
Robert Moore
65bf96dd7c [Math] MDCRectAlignToScale treats scale 0 as 1 (#2045)
Rather than potentially returning a CGRectNull and causing UIKit crashes
if it's assigned to a view's frame or bounds, treat a scale of 0 as a
scale of 1.

Closes #2044
2017-09-27 20:28:37 +09:00
Robert Moore
4fd3a41963 [Math] Round CGPoint and align UIView centers (#2042)
Although it is possible to currently align a CGRect (frame) to a
pixel-aligned bounding rectangle, in some cases manipulating the frame
is neither possible nor desirable (such as when the transform is not the
identity).  Adding two new methods to support rounding a CGPoint to a
pixel and aligning the center point of a UIVIew given its bounds.
2017-09-27 01:54:56 +09:00
Junius Gunaratne
d200d6cdef [Math] Add degrees to radians method to MDCMath (#2015)
* Adding radian/degree math

* Cast to float
2017-09-21 10:02:58 -07:00
Robert Moore
2a65ea5809 [Math] Adding more unit tests for rect alignment (#1751)
Adding unit tests for a scale of zero and CGRectNull inputs.

References #1723
2017-08-08 12:03:02 -04:00
Robert Moore
e03ad370c6 [Math] Align frames to pixel boundaries (#1730)
Adding a new function to realign a CGRect (frame) to pixel boundaries
based on the screen scale. After a review of the catalog, I'm updating
the areas where I found misaligned frames.

Closes #1723
2017-08-07 16:46:32 -04:00
Sam Morrison
f466588e4f [Feature Highlight] Swipe to dismiss (#1636)
* Add new Dismiss gesture recognizer to allow swiping away feature highlights

* Tap outside the feature highlight to dismiss

* Formatting and cleanup

* Fix unused var warnings

* Correctly cancel animation when gesture recognizer gets cancelled

* Fade out text when starting dismiss gesture

* Formatting

* Ignore multiple touches

* Remove debug state logging

* Fade text in/out during dismissal gesture

* Address comments

* Prevent floating point conversion warnings

* MDCPow / MDCSqrt

* Add accessibilityPerformEscape to feature highlight
2017-07-17 17:59:03 -04:00
Will Larche
d8a58feecd [All] Formatting. (#1329) 2017-04-18 18:10:02 -04:00
Will Larche
ff5d165869 [Math] New private math component (#1325)
* [Math] New private component.

* [Math] Putting MaterialMath everywhere it could help.
2017-04-17 16:14:17 -04:00