* merge MDCShapeCorner and MDCCornerTreatment into one
* update tests
* add initial percentage API to MDCCornerTreatment
* update
* clang update
* added percentage support for corner treatments
* clang update
* working on fix
* clang
* update
* clang
* pass CI
* pass CI
* merge MDCShapeCorner and MDCCornerTreatment into one
* update tests
* add initial percentage API to MDCCornerTreatment
* update
* clang update
* added copy support for the new API
* added tests
This is a follow up PR to #5090 and contains all of its changes as well until that PR is merged.
We are adding a percentage API to MDCCornerTreatment by adding the removed value type from MDCShapeCorner and moving it into MDCCornerTreatment. This allows us to provide percentage values to corners on a component level and let it be set in the right time in the lifecycle.
Percentage support for each component will be added as follow up PRs once this is landed.
This PR changes the recent addition of convenience initializers of MDCCornerTreatments to become a certain instance subclass to use concrete types rather than a generic NSNumber with parsing. This resolves#5063
This PR implements the initial Shape Scheme that is essential for allowing shape theming for components (*this doesn't include any themers and that will be included as a separate PR once this is approved*). More information can be seen in go/mdc-ios-shape-theming and go/material-shapes-eng
This closes#4609#4612#4613
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.
```
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.
```
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
The intent of the Alpha program is to provide a place for component code to land that may not be fully ready for production, but for which we still want active collaboration with the team and potentially some early adoption with select clients.
Any new component that we implement will first land in the MaterialComponentsAlpha.podspec as a subspec, similar to how components are defined in the MaterialComponents.podspec.
Alpha components will appear in MDCCatalog and MDCDragons along with all of their examples and unit tests after a `pod install`. From the point of view of our catalogs, these components are just like any other.
From the point of view of the public, Alpha components are not made available as part of our published pod. External clients that wish to use an Alpha component in their app will need to manually clone the repo and add the code to their project. This is by design.
Alpha components are not subject to our deprecation policy and we will not provide behavioral flags for gradual migration of runtime behaviors.
Changes to Alpha components will have **no** effect on our release version numbers.
Once a component is ready for general production use, we will graduate the component to the MaterialComponents.podspec. At this point the component will be subject to all of the processes and expectations that any other production component.
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);
~~~~~~~~~~ ^~~~
Since you are paying for the cost of creating one of these things before main, do a little bit to reduce the overhead by removing two unnecessary calls. (Yes it did show up on a profile... and yes it is a microoptimization, but I don't think it detracts from the readability).
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.
* Updated known shortlink destination URLs to use short links.
* Updated stray links in the CHANGELOG.md.
* Fixed FAB shortlink.
* Applied replacements to everything outside of components/.
Slider will require additional API from ThumbTrack to support upcoming color
parameterization. As a first step, MDCThumbTrack is being refactored to
increase its API to support broader customization.
Partially implements #3137
* Add Slider appearance properties and enable UIAppearance.
Adds `thumbRadius` and `thumbElevation` as UIAppearance properties.
Makes `color`, `disabledColor`, and `trackBackgroundColor` UIAppearance-compatible.
* Added unit tests for slider.
* Remove infeasible coding unit test for now.
* Line-length formatting.
* Rename and condense color tests, sort by order that they appear in the header.
* Rename tests and mark the thumb section.
* Replace `_thumbTrack.thumbRadius` usage with `self.thumbRadius`.
* Remove NSCoding-related helper, moved to another branch.
* Search-and-replace mixup.
* Line-length fixups.
When being deallocated, the OverlayObserver should unregister notifications.
On iOS versions before 9 (8 and below), the NSNotificationCenter unsafely
retains references to any observers. On iOS 9 and above, it will keep safe
unretained references. This bug wasn't found previously because only the
static singleton was ever used by client components and there were no unit
tests for the component.
Closes#2685
* Documented, clarified, and cleaned up warning flags.
* Fixed places where properties are missing `nonatomic`.
* Removed unused MDC_DEPRECATION_WARNINGS.
* Reviewer suggestions.
* Changed -Wshadow-all back to -Wshadow, since -Wshadow-all doesn't seem to be supported by Kokoro?
* Use framework-style imports.
MDFInternationalization is built as a framework, so use the style
recommended to import from the framework (#import <...>).
MotionAnimator and MotionInterchange mixed the normal style import
and the framework style import; settle them on the framework style.
* Update MDCActivityIndicator.m
Re-order to match our style guide.
* Update MDCBottomNavigationBar.m
Re-order to match our style guide.
* Update MDCBottomNavigationItemView.m
Re-order to match style guide.
* Update MDCBottomAppBarView.m
* Update MDCButtonBar.m
* Update MDCAppBarButtonBarBuilder.m
* Update MDCAppBarButtonBarBuilder.m
* Update MDCCollectionViewCell.m
* Update MDCAlertController.m
* Update NavigationBarIconsExample.m
* Update MDCNavigationBar.m
* Update MDCItemBarCell.m
* Update MDCTextField.m
* Update MDCThumbTrack.m