29 Commits

Author SHA1 Message Date
Bryan Oltman
f40e7f09ca
[Catalog] Improve contrast ratio in PageControlTypicalUseViewController (#8941) 2019-11-15 13:20:03 -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
Andrew Overton
21dfce7f5f
[PageControl] Add respectsUserInterfaceLayoutDirection to MDCPageControl (#5711)
### The problem

The MDCPageControl has never respected user interface layout direction.

### The solution

Make the MDCPageControl capable of respecting user interface layout direction through the addition of a `respectsUserInterfaceLayoutDirection` property.

Here is a gif of the new RTL behavior, with `respectsUserInterfaceLayoutDirection` set to `YES`:
![after_rtl_2](https://user-images.githubusercontent.com/8020010/48214767-a7fb0400-e34e-11e8-902a-2585c1d5111f.gif)

Here is a gif of the preexisting LTR behavior, with `respectsUserInterfaceLayoutDirection` set to `NO`:
![after_ltr_2](https://user-images.githubusercontent.com/8020010/48214766-a7fb0400-e34e-11e8-974a-b202f600dbc9.gif)

Note that this PR also updates the PageControl typical use example to use this new API.

Closes #5608.
2018-11-14 09:50:54 -05:00
Robert Moore
03f3351ad5
Global replace of single-precision floats with CGFloat casts. (#5718)
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat.  For example, `0.1f` should become `(CGFloat)0.1`.

Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```

PiperOrigin-RevId: 220683126
2018-11-12 10:50:01 -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
Wenyu Zhang
2fee13665f
[FlexibleHeaderView] Make FexibleHeaderView respect contentInsetAdjustmentBehavior (#4970) (#5073)
This fix is compatible for iOS 11 and above. For pre iOS11 version, FlexibleHeaderView still insets the contentInset. To fix it, we need to use a deprecated API automaticallyAdjustsScrollViewInsets from a view controller, which is not supported by the current FlexibleHeaderView architecture. Suggestions are welcomed.

Before the Change:
![pc2](https://user-images.githubusercontent.com/8836258/45308459-8072f100-b4ef-11e8-9642-7afedfc17010.gif)

After the Change:
![pc1](https://user-images.githubusercontent.com/8836258/45308287-1f4b1d80-b4ef-11e8-8359-08b079af40e5.gif)
2018-09-18 14:08:51 -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
Robert Moore
2fd85a2c29
[Tabs] Fix format string types in debug, examples (#3195)
Xcode 9.3 is now complaining that our format strings are accepting the wrong
type for NSIntegers. Explicitly casting to formattable types.
2018-03-30 12:53:52 -04:00
Robert Moore
29af16e46d [PageControl] Fixing example layout (#3059)
The page control was not being sized before being positioned within the
view, so it was cut-off by half the height.

Closes #2858
2018-03-07 15:43:00 -05: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
b1ec22207f
Fixed float conversion build errors (#2602)
* Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480

* More Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480
2017-12-06 15:57:04 -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
ianegordon
2ed1139d69 [PageControl] safeArea fixes (#2301)
* PageControl safeArea fixes

* Indentation Pass
2017-10-29 15:41:32 -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
Alastair Tse
4a46c8c19e Monochromatic sweep of all catalog components (#1370)
* Replace MDC all icons

* Update border

* Replace MDCActionExtension icon with new logo

* Update all headers to be white on black

* Make Catalog greyscale to match Material’s style.

* Fix collection tile

* Update all headers to be white on black

* Make Catalog greyscale to match Material’s style.

* Fix collection tile

* WIP: Updating TabBar example to use black/green theme.

* WIP: Monochoroming all examples.

* Switch MDC Catalog to a black and white theme (#1355)

* Replace MDC all icons

* Update border

* Replace MDCActionExtension icon with new logo

* Update all headers to be white on black

* Make Catalog greyscale to match Material’s style.

* Fix collection tile

* Update all headers to be white on black

* Make Catalog greyscale to match Material’s style.

* Fix collection tile

* Fix floats

* Make Catalog greyscale to match Material’s style.

* More black and whiting

* WIP: Snackbar and global style

* Simplify snack bar examples.

* Page control
2017-05-05 16:16:47 -04: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
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
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
Will Larche
2ab08f4133 [Catalog & Examples] Added navigationBar example in Swift (Supplemental POC) and corrected slight mistake in Catalog by Convention logic.
Summary: Merge branch 'develop' of https://github.com/google/material-components-ios into develop

Reviewers: ajsecord, featherless, #mdc_ios_owners

Reviewed By: ajsecord, featherless, #mdc_ios_owners

Subscribers: featherless, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D587
2016-04-13 14:56:49 -04:00
randallli
317fffcf52 [PageControl] Example: fix vertical scrolling behaviour.
Summary:
Closes: https://github.com/google/material-components-ios/issues/115

Also fixes ScrollViewMultiplexerExample.
Fixes rotation issues with page not being preserved.

Reviewers: cjcox, larche, #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D582
2016-04-13 10:30:10 -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
Junius Gunaratne
9c6a523430 [Catalog] Use blue design colors for page control demo
Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Subscribers: featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D494
2016-04-06 11:57:56 -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
90efa3fa07 [Catalog] Style and polish main component screen
Summary:
New component collection view screen. Uses generic spec colors.

Screen shot:
http://codereview.cc/M1

Reviewers: ajsecord, featherless, #mdc_ios_owners

Reviewed By: featherless, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D223
2016-03-08 16:11:46 -05:00
Jeff Verkoeyen
248b499488 [Catalog] Move Ink, PageControl, and SVDMultiplexer to the catalog convention.
Summary:
This simplifies the examples for each of these components.

The other components have a few extra features that may take a bit more time to migrate over,
notably:

- Swift (ShadowLayer)
- Resources (SpritedAnimationView)
- Unit and UI tests (Switch, Typography)

Reviewers: junius, randallli, #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Subscribers: ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D124
2016-03-01 12:42:21 -05:00