180 Commits

Author SHA1 Message Date
Gabe Giosia
f5a7a0d474 [MDCSlider] Allow setting exclusiveTouch on Sliders. (#5326)
reopening GH-5237

Exclusivetouch allows the developer to stop multitouch interactions within a window that are undesirable. https://developer.apple.com/documentation/uikit/uiview/1622453-exclusivetouch

closes #5236
2018-10-23 15:47:41 -04:00
Yarden Eitan
e114499adc
[Shapes] Added full support for intaking percentage values in the internal shape generation (#5100)
* 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
2018-09-12 00:59:01 -04:00
Yarden Eitan
a52dc18590
[Shapes] Added copy support for the new percentage API support (#5099)
* 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
2018-09-11 19:54:15 -04:00
Yarden Eitan
78510eb89f
[Shapes] Add percentage API to MDCCornerTreatment (#5091)
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.
2018-09-11 17:40:53 -04:00
Yarden Eitan
c01cd70170
[ShapeLibrary] Make the new CornerTreatment initializers use concrete types (#5076)
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
2018-09-10 15:41:50 -04:00
Yarden Eitan
7b9583cc12
[Shape] Add isEqual support to our corner treatments (#5030)
This will make it easier to compare between corner treatments for testing purposes among other things.
2018-09-07 11:00:36 -04:00
Yarden Eitan
97b830a1e3
[Shapes] Initial Shape Scheme implementation (#5014)
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
2018-09-06 13:35:05 -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
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
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
featherless
bb194fa168
Introduce an Alpha program for MDC components. (#4892)
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.
2018-08-24 14:55:42 -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
dmaclach
6f0b332569 Small optimization at load time (#4657)
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).
2018-07-30 12:39:51 -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
Adrian Secord
72045ffd6d
[Docs] Updated known short link destination URLs to use short links. (#3575)
* 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/.
2018-04-28 11:27:59 -04:00
Yarden Eitan
23a752db2c
[Catalog] One more icon needed for the menu in our catalog (#3492)
pivotal: https://www.pivotaltracker.com/story/show/156997977
2018-04-25 15:43:18 -04:00
Yarden Eitan
9a64164bed
[Catalog] Addition of Icons for our Catalog app settings menu (#3487)
pivotal: https://www.pivotaltracker.com/story/show/156997977
2018-04-25 15:02:29 -04:00
Yarden Eitan
6112466dac
expose color layer (#3379) 2018-04-17 15:06:32 +03:00
Yarden Eitan
fa034e42a2
expand init (#3378) 2018-04-17 15:03:53 +03:00
Robert Moore
aa29efaa42
[ThumbTrack] Add support for colored tick marks (#3329)
The Slider needs a way to color the tick marks within the "filled"
region differently from the tick marks in the "unfilled" region of the
track. The ThumbTrack should support an API that allows customization of
the colors and definition of the "filled" or "active" track area.

**Resulting Effect (with non-default colors)**
![slider-colored-dots](https://user-images.githubusercontent.com/1753199/38683860-63175184-3e3c-11e8-9014-7c55a528a942.gif)

**Before**
![slider-ticks-before](https://user-images.githubusercontent.com/1753199/38697970-796153de-3e61-11e8-9c7e-6dc29755e381.png)

**After**
![slider-ticks-after](https://user-images.githubusercontent.com/1753199/38697976-7cbf6084-3e61-11e8-9cf5-e873abffdef4.png)



Partially implements #3137
Pivotal story: https://www.pivotaltracker.com/story/show/155525171
2018-04-12 15:44:39 -04:00
Robert Moore
e52f891ddc
[ThumbTrack] Fix valueLabel backgroundColor (#3322)
The discrete value label's background color was not being set when
setting the `primaryColor`. Since there is currently no public API (via
MDCSlider) to set the color, this can cause undesirable color mismatches
in clients.

**Before**
![slider-valuelabel-bug](https://user-images.githubusercontent.com/1753199/38622949-66f54cd6-3d72-11e8-8c33-df8b28ddb319.png)

**After**
![slider-valuelabel-fixed](https://user-images.githubusercontent.com/1753199/38622957-6c0c4e2c-3d72-11e8-9e9c-34c6a3b14dbc.png)


Fixes #3321
2018-04-11 16:16:42 -04:00
Robert Moore
f9b034955f
[ThumbTrack] Refactoring to open the API (#3291)
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
2018-04-09 23:09:27 -04:00
Yarden Eitan
af2a3c89d2
[Cards] Added Shapes support for MDCCard and MDCCardCollectionCell + 2 Examples (#3215) 2018-04-05 15:51:34 +03:00
Yarden Eitan
7b742b5745
[Kokoro / CI] Have Kokoro test multiple iOS versions and simulators on different Xcodes. (#3117)
* Remove dependency on Travis by having Kokoro test multiple iOS versions and simulators on different Xcodes.

* refactor

* refactor

* refactor
2018-03-21 09:40:30 -04:00
Mohammad Cazi
261828a056
[Warnings Fix] Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior. (#2933)
* Warning Fix: Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior.

* 100 char limit.
2018-02-14 15:47:07 -05:00
Randall Li
5d062f16b6 added test 2018-02-09 13:49:04 -05:00
Randall Li
c236cfee98 [MDCIcon] fixed bundle cache call because bundle may not exist 2018-02-09 13:49:03 -05:00
ianegordon
7ac5e5b22d
[Shapes] Add a Shapelibrary header (#2818)
* Add ShapeLibrary header

* Add final newline
2018-01-09 13:15:52 -05:00
Yarden Eitan
3fe2bff374
[Podspec] Fix podspec warnings when issuing a lint (#2811)
* added supressing of partial-availability and changed image bit depth to remove podspec warnings on linting

* added code check
2018-01-08 11:45:11 -05:00
Adrian Secord
294643fc0b
[Slider] Add appearance properties and enable UIAppearance. (#2796)
* 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.
2018-01-07 12:15:02 -05:00
Robert Moore
e4dee54222
[KeyboardWatcher] Add no-op test (#2752) 2017-12-20 15:38:38 -05: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
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
Sam Morrison
1a68851bef [Shapes] Remove MDCShapedShadowLayer fillColor property (#2716)
* [Shapes] Remove MDCShapedShadowLayer fillColor property

* Fix MDCShapedView
2017-12-14 08:47:28 -05:00
Robert Moore
d3e30ec933
[ShapeLibrary] Add BUILD file and no-op tests (#2710)
There is no umbrella header, so the tests just import all the things and init their main classes.
2017-12-14 05:40:03 -05:00
Sam Morrison
6466f6fdcf
[Shapes] Custom properties for consistent behavior (#2691)
* [Shapes] Custom properties for consistent behavior

* Ordering
2017-12-13 11:39:22 -05:00
Robert Moore
c4d5e18cc5
[Overlay] Add missing QuartzCore dependency (#2692) 2017-12-13 08:08:54 -05:00
Robert Moore
f0e9b19812
[OverlayObserver] Unregister in dealloc (#2686)
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
2017-12-12 19:09:08 -05:00
Robert Moore
27e87223fb
[Shapes] Add BUILD file and noop test (#2675) 2017-12-11 13:27:40 -05:00
Robert Moore
0e8d5f68fe
[Overlay] Add BUILD file and noop test (#2674) 2017-12-11 13:27:22 -05:00
Robert Moore
e22b99cfef
[ThumbTrack] Add BUILD file and noop test (#2673) 2017-12-11 13:27:08 -05:00
Robert Moore
d7f52c5e83 [Icons] Add BUILD files (#2670)
Changing framework-style import in test due to Bazel incompatibility.
2017-12-09 18:00:07 -05:00
Sam Morrison
9b097023fb
[Shapes] Implicitly animate shape path on resizing (#2619)
* [Shapes] Implicitly animate shape path on resizing

* Remove MDCShapelayer
2017-12-07 19:25:09 -05:00
featherless
b9404ded10
Revert "Add compile time flag for import style (#2562)" (#2612)
This reverts commit 6791dc4993d3a0ffa11735eeeef0583102621d52.
2017-12-06 11:22:17 -05:00
Louis Romero
6791dc4993
Add compile time flag for import style (#2562)
Closes #2550
2017-12-04 10:06:31 -08:00
Adrian Secord
b558c28e34 Clean up warning flags (#2456)
* 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?
2017-11-20 11:16:46 -05:00
Sylvain Defresne
c3615fa300 Use framework-style imports. (#2428)
* 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
2017-11-17 10:39:48 -05:00