### Context
As the team pivots to using theming within extensions we have started off with buttons as a test run. This will be part fo the work with buttons only addressing the contained button type. This adds a new method to MDCButton - `applyContainedThemeWithScheme:(id<MDCContainerScheming>)scheme`
### The problem
We currently do not theme buttons the way the team has decided to theme them
### The fix
This themes Contained buttons with the new style we have all agreed on.
### Remaining Work
Theming for Text and Outlined buttons in this new style.
This is a follow up PR for #5119 and #5120 and relies on both.
This integrates the created shape themer for buttons into the examples that currently use color/typography themers.
This closes#5050
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.
```
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
This enables the new FlexibleHeader/AppBar behavior that correctly updates the content view controller's safe area insets/top layout guide to match the flexible header's height and sets the frame of the content view controller to match the bounds of the container view controller.
As part of this change, we were able to remove the Catalog logic that would manually adjust the frame of examples that did not have a scroll view. Examples are now expected to adjust their content according to the top layout guide / safe area insets, as can be seen in the ButtonsTypicalUse example.
Examples that *do* have a scroll view will also now make use of the correct top layout guide / safe area insets behavior. This behavioral change can most notably be seen in the ActivityIndicator example, which no longer has a 20 point "dead zone" above the table view.
Pivotal Story: https://www.pivotaltracker.com/story/show/156616695
This includes an implementation example in the ButtonTypicalUse example. In a separate PR will this be added to the rest of our examples.
Pivotal Story: https://www.pivotaltracker.com/story/show/156168281
* Implementation of Shapes support in Buttons.
* Added example of using shapes on different styles of buttons (see screenshot and gif below).
* Exposed an initializer for MDCCurvedCornerTreatment to be able to use in the example.
* Exposed the color sublayer in MDCShapedShadowLayer to allow hierarchal reordering of sublayers for a shaped button to work with ink and shadow correctly.
* Updated unit tests.
* 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
The FAB in Typical Use was misaligned, resulting in a blurry image. The
Storyboard and Swift example had misaligned buttons due to
safeAreaInsets on iOS 11.
* [Buttons] Deprecate subclassing cornerRadius and defaultContentEdgeInsets
* Remove unused import
* Set contentEdgeInsets via UIAppearance
* Content edge insets comment
* Use correct value for FAB hit area insets
* Fix FAB contentEdgeInsets
* [Buttons] Deprecate subclassing cornerRadius and defaultContentEdgeInsets
* Remove unused import
* Set contentEdgeInsets via UIAppearance
* Content edge insets comment
* Use correct value for FAB hit area insets
* Fix FAB contentEdgeInsets
The manual layout code was disabling automatic constraints generation
and trying to lay-out the view before subviews were laid-out. The
combination led to broken layout on iOS 9 the first time the view was
loaded.
Resolves#1757
The Floating Action Button (FAB) is supposed to "pop-in" to a view when the
view appears. Adding some basic animation code to allow the FAB to be
animated-in and -out of views.
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
* 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.
* 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.
* [MDCInkView] cancelAllAnimationsAnimated should support disabling animation
* [MDCProgressView] Allow completion block to be modified if setHidden:animated:completion is called sequentially
* Call completion block immediately rather than storing as a property.
* Add nil check for completion block
* [Shrine] Update to Swift 3
* [AppBar] Add Objective C AppBar storyboard example
* Add right button bar item to AppBar swift demo
* Add plus shape icon to FAB
* Move plus symbol to example code
* Add plus icon asset, move to supplemental
* Remove unused methods
* Undo change to print.
* Move plus CAShapeLayer code into its own method
* Remove plus path method
* Use supplemental method to get plus symbol CAShapeLayer
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