42 Commits

Author SHA1 Message Date
Jeff Verkoeyen
26b93a614e [Buttons] Delete flaky shaped buttons example.
PiperOrigin-RevId: 610455542
2024-02-26 10:41:30 -08:00
Nobody
e87240717e Test Cleanup
PiperOrigin-RevId: 516253403
2023-03-13 10:38:56 -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
Alyssa Weiss
1b69273926 Delete MDCTypography font opacities.
PiperOrigin-RevId: 394494448
2021-09-02 10:44:20 -07:00
Yarden Eitan
84b83bdb8b Internal Change
PiperOrigin-RevId: 364584460
2021-03-23 10:11:16 -07:00
Jeff Verkoeyen
8465222386 [Buttons] Attempt to reduce flakiness of the buttons screenshot tests.
PiperOrigin-RevId: 364466639
2021-03-22 19:46:29 -07:00
Jeff Verkoeyen
3a157e1f43 [Buttons] Standardize all examples on the same <Component><Example>Example pattern.
PiperOrigin-RevId: 305332675
2020-04-07 13:53:57 -07: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
4f0786a2bf
[Buttons] Add themer for contained buttons with container scheme (#5849)
### 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.
2018-11-28 18:11:11 -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
Yarden Eitan
08bb1d707a
[Buttons] Integration of the button shape themer into the examples (#5121)
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
2018-09-14 13:49:27 -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
bbe4a23fe0
Remove all __IPHONE_11_0 checks now that we no longer support Xcode 8. (#4915)
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
2018-08-28 09:57:30 -04:00
Wenyu Zhang
2444107e30
[Buttons] fix the text overlapping safeArea issue on
ButtonsShapesExampleViewController (#3703)

closes #3703 

#####Screenshots before the change:    
![before1](https://user-images.githubusercontent.com/8836258/44283102-4a618a80-a22b-11e8-955e-bfcc55f387ca.png)

![before2](https://user-images.githubusercontent.com/8836258/44283032-fc4c8700-a22a-11e8-9c9a-93626bc4a063.png)

####Screenshots after the change:
![after1](https://user-images.githubusercontent.com/8836258/44283041-040c2b80-a22b-11e8-94a4-1c5365474e8a.png)
![after2](https://user-images.githubusercontent.com/8836258/44283042-040c2b80-a22b-11e8-82d7-5bbdba149a8a.png)
2018-08-20 12:36:49 -04:00
Robert Moore
c43677ace0
[Buttons] Fix safeAreaInsets availability check (#4775)
Only iOS 11+ has `safeAreaInsets` defined, so the compiler may complain when
we try to include without runtime guards available.
2018-08-14 12:37:43 -04:00
featherless
abae199d71
[Catalog] Enable AppBar's isTopLayoutGuideAdjustmentEnabled in all examples. (#4537)
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.
2018-07-12 15:43:53 -04:00
Mohammad Cazi
5ee14ab92e
[Catalog] Component descriptions update. (#3490)
* Button Description updated.

* Updating the description of Catalog Components.

* Missing space.

* fixing couple of small issues with catalog descriptions.

https://github.com/material-components/material-components-ios/pull/3490
2018-04-25 16:06:18 -04:00
Yarden Eitan
27eac8c05c
[Catalog] Implement API for setting app-wide theming (#3461)
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.
2018-04-24 11:08:54 -04:00
Randall Li
827552a840 [Button] Fixed catalog description of typical use example (#3435) 2018-04-20 16:45:42 -04:00
Yarden Eitan
67a68d3d3c
[Buttons] Added Shapes Support (#3368)
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.
2018-04-17 19:42:12 +03: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
00611df7bd
[Buttons] Corrected imports in examples. (#2645)
* [Buttons] Corrected imports in examples.

PiperOrigin-RevId: 175377616

* added import UIKit
2017-12-08 11:40:03 -05:00
Randall Li
2f29f00d86 Fixed some compiler warnings (#2426)
* 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
2017-11-22 10:51:55 -05:00
Yurii Samsoniuk
2a96682230 Replace unnecessary imports with forward declarations (#2429)
* [Themes] Remove unnecessary imports.

* [TextFields] Remove unnecessary imports.

* [Typography] Do not use an umbrella header inside of a component.

* [Snackbar] Do not use self umbrella header.

* [ActivityIndicator] Do not use self umbrella header.

* [AppBar] Use umbrella headers.

* [AppBar] Remove self import header.

* [ButtonBar] Removed self umbrella header imports.

* [Buttons] Removed self umbrella header imports.

* [Collections] Update imports.

* [Dialogs] Moved import into an m file.

* [Collections] Fixed imports.

* [FeatureHighlight] Removed self umbrealla imports.

* [HeaderStackView] Reordered imports.

* [Ink] Replaced imports with forward declarations.

* [Slider] Replaced self umbrella import use.

* [Snackbar] Removed self umbrella header import.

* [Tabs] Changed math import. Replaced self umbrella header import.

* [Icons] Removed unnecessary imports.

* [Overlay] Replaced umbrella header import.

* [ShapeLibrary] Replace Shapes imports with an umbrella header.

* [Shapes] Replaced imports with forward declarations.

* [AppBar] Replace import with a forward declaration.

* [Examples] Updated imports.

* Fixed conflicting imports

* Added space between different import categories
2017-11-16 18:25:06 -05:00
Robert Moore
d44164290f [Catalog] Fix button examples (#2047)
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.
2017-09-27 23:58:17 +09:00
Sam Morrison
0e3b57c785 Revert [Buttons] Deprecate subclassing to set cornerRadius and contentEdgeInsets (#1896) (#1948)
* [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
2017-09-05 14:15:58 -04:00
Sam Morrison
3951775187 [Buttons] Deprecate subclassing to set cornerRadius and contentEdgeInsets (#1896)
* [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
2017-08-31 15:06:19 -04:00
Robert Moore
4c6d0ba437 [Catalog] Fix button typical use layout on iOS 9 (#1769)
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
2017-08-10 17:59:24 -04:00
Robert Moore
aaab9e6bb2 [Buttons] Creating animations for FAB appearance (#1755)
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.
2017-08-10 15:52:49 -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
04b8ced5a4 [Buttons] Add a stroked button to the examples (#1714) 2017-08-01 15:53:36 -07: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
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
Sam Morrison
dff304e062 Add missing license headers (#900) 2016-11-30 09:43:22 -05:00
Junius Gunaratne
4596b7c861 [MDCFloatingButton] Floating action button should use a shape rather than text (#833)
* [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
2016-11-16 13:31:59 -05:00
randallli
681cc2b6f7 [Docs] Replaced incorrect name of the product. Material Components *for* iOS
Summary:
s/material components ios/Material Components for iOS/
s/material components for ios/Material Components for iOS/

lint copy edit line length

Reviewers: ajsecord, O1 Material components iOS

Reviewed By: ajsecord, O1 Material components iOS

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1372
2016-08-01 16:45:12 -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
Adrian Secord
3aedace959 Re-enabled 100-character line limit.
Reviewers: randallli, O1 Material components iOS

Reviewed By: randallli, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D965
2016-06-13 13:34:57 -04:00
Junius Gunaratne
28e1904f78 [Catalog] Adjust layout for button example in landscape mode, move layout to supplemental
Summary: Screenshot http://codereview.cc/M24

Reviewers: ajsecord, featherless, #mdc_ios_owners

Reviewed By: featherless, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D661
2016-04-19 12:02:07 -04:00